… | |
… | |
19 | |
19 | |
20 | #include "config.h" |
20 | #include "config.h" |
21 | #include <stdio.h> |
21 | #include <stdio.h> |
22 | #include <string.h> |
22 | #include <string.h> |
23 | #include <stdlib.h> |
23 | #include <stdlib.h> |
24 | #include "data.h" |
24 | #include "psiconv/data.h" |
25 | #include "list.h" |
25 | #include "psiconv/list.h" |
26 | #include "gen.h" |
26 | #include "gen.h" |
27 | #include "psiconv.h" |
27 | #include "psiconv.h" |
|
|
28 | |
|
|
29 | #ifdef DMALLOC |
|
|
30 | #include "dmalloc.h" |
|
|
31 | #endif |
28 | |
32 | |
29 | /* This determines for each character how it is displayed */ |
33 | /* This determines for each character how it is displayed */ |
30 | static const char *char_table[0x100] = |
34 | static const char *char_table[0x100] = |
31 | { |
35 | { |
32 | /* 0x00 */ "" ,"" ,"" ,"" ,"" ,"" ,"<P> ","<BR>" , |
36 | /* 0x00 */ "" ,"" ,"" ,"" ,"" ,"" ,"<P> ","<BR>" , |
… | |
… | |
100 | 13.0, /* font_size */ |
104 | 13.0, /* font_size */ |
101 | psiconv_bool_false, /* italic */ |
105 | psiconv_bool_false, /* italic */ |
102 | psiconv_bool_false, /* bold */ |
106 | psiconv_bool_false, /* bold */ |
103 | psiconv_normalscript, /* super_sub */ |
107 | psiconv_normalscript, /* super_sub */ |
104 | psiconv_bool_false, /* underline */ |
108 | psiconv_bool_false, /* underline */ |
105 | psiconv_bool_false, /* strike_out */ |
109 | psiconv_bool_false, /* strikethrough */ |
106 | NULL, /* font */ |
110 | NULL, /* font */ |
107 | }; |
111 | }; |
108 | base_char_struct.color = color; |
112 | base_char_struct.color = color; |
109 | base_char_struct.back_color = back_color; |
113 | base_char_struct.back_color = back_color; |
110 | base_char_struct.font = font; |
114 | base_char_struct.font = font; |
… | |
… | |
131 | fputs("</I>",of); |
135 | fputs("</I>",of); |
132 | if (old->bold) |
136 | if (old->bold) |
133 | fputs("</B>",of); |
137 | fputs("</B>",of); |
134 | if (old->underline) |
138 | if (old->underline) |
135 | fputs("</U>",of); |
139 | fputs("</U>",of); |
136 | if (old->strike_out) |
140 | if (old->strikethrough) |
137 | fputs("</STRIKE>",of); |
141 | fputs("</STRIKE>",of); |
138 | if (old->super_sub == psiconv_superscript) |
142 | if (old->super_sub == psiconv_superscript) |
139 | fputs("</SUP>",of); |
143 | fputs("</SUP>",of); |
140 | if (old->super_sub == psiconv_subscript) |
144 | if (old->super_sub == psiconv_subscript) |
141 | fputs("</SUB>",of); |
145 | fputs("</SUB>",of); |
… | |
… | |
158 | fputs("6",of); |
162 | fputs("6",of); |
159 | else |
163 | else |
160 | fputs("7",of); |
164 | fputs("7",of); |
161 | fprintf(of," COLOR=#%02x%02x%02x",new->color->red,new->color->green, |
165 | fprintf(of," COLOR=#%02x%02x%02x",new->color->red,new->color->green, |
162 | new->color->blue); |
166 | new->color->blue); |
163 | if (new->font->screenfont == 1) |
167 | if (new->font->screenfont == psiconv_font_sansserif) |
164 | fprintf(of," FACE=\"%s, Sans-Serif\">",new->font->name); |
168 | fprintf(of," FACE=\"%s, Sans-Serif\">",new->font->name); |
165 | else if (new->font->screenfont == 2) |
169 | else if (new->font->screenfont == psiconv_font_nonprop) |
166 | fprintf(of," FACE=\"%s, Monospace\">",new->font-> name); |
170 | fprintf(of," FACE=\"%s, Monospace\">",new->font-> name); |
167 | else if (new->font->screenfont == 3) |
171 | else if (new->font->screenfont == psiconv_font_serif) |
168 | fprintf(of," FACE=\"%s, Serif\">",new->font-> name); |
172 | fprintf(of," FACE=\"%s, Serif\">",new->font-> name); |
169 | else |
173 | else |
170 | fprintf(of," FACE=\"%s, Serif\">",new->font-> name); |
174 | fprintf(of," FACE=\"%s, Serif\">",new->font-> name); |
171 | } |
175 | } |
172 | if (new->italic) |
176 | if (new->italic) |
173 | fputs("<I>",of); |
177 | fputs("<I>",of); |
174 | if (new->bold) |
178 | if (new->bold) |
175 | fputs("<B>",of); |
179 | fputs("<B>",of); |
176 | if (new->underline) |
180 | if (new->underline) |
177 | fputs("<U>",of); |
181 | fputs("<U>",of); |
178 | if (new->strike_out) |
182 | if (new->strikethrough) |
179 | fputs("<STRIKE>",of); |
183 | fputs("<STRIKE>",of); |
180 | if (new->super_sub == psiconv_superscript) |
184 | if (new->super_sub == psiconv_superscript) |
181 | fputs("<SUP>",of); |
185 | fputs("<SUP>",of); |
182 | if (new->super_sub == psiconv_subscript) |
186 | if (new->super_sub == psiconv_subscript) |
183 | fputs("<SUB>",of); |
187 | fputs("<SUB>",of); |
… | |
… | |
198 | if (old->underline) |
202 | if (old->underline) |
199 | fputs("</U>",of); |
203 | fputs("</U>",of); |
200 | else |
204 | else |
201 | fputs("<U>",of); |
205 | fputs("<U>",of); |
202 | } |
206 | } |
203 | if (old->strike_out != new->strike_out) { |
207 | if (old->strikethrough != new->strikethrough) { |
204 | if (old->strike_out) |
208 | if (old->strikethrough) |
205 | fputs("</STRIKE>",of); |
209 | fputs("</STRIKE>",of); |
206 | else |
210 | else |
207 | fputs("<STRIKE>",of); |
211 | fputs("<STRIKE>",of); |
208 | } |
212 | } |
209 | if (old->super_sub != new->super_sub) { |
213 | if (old->super_sub != new->super_sub) { |