… | |
… | |
130 | } |
130 | } |
131 | } |
131 | } |
132 | |
132 | |
133 | static const char *screenfont_name(psiconv_u8 screenfont) |
133 | static const char *screenfont_name(psiconv_u8 screenfont) |
134 | { |
134 | { |
135 | if (screenfont == 1) |
135 | if (screenfont == psiconv_font_sansserif) |
136 | return "sans-serif"; |
136 | return "sans-serif"; |
137 | else if (screenfont == 2) |
137 | else if (screenfont == psiconv_font_nonprop) |
138 | return "monospace"; |
138 | return "monospace"; |
139 | else if (screenfont == 3) |
139 | else if (screenfont == psiconv_font_serif) |
140 | return "serif"; |
140 | return "serif"; |
141 | else |
141 | else |
142 | return "serif"; |
142 | return "serif"; |
143 | } |
143 | } |
144 | |
144 | |
… | |
… | |
468 | |
468 | |
469 | fputs("<!doctype html public \"-//W3C//DTD HTML 4.0 STRICT//EN\">", of); |
469 | fputs("<!doctype html public \"-//W3C//DTD HTML 4.0 STRICT//EN\">", of); |
470 | fputs("\n<HTML>\n<HEAD>\n <META NAME=\"GENERATOR\"", of); |
470 | fputs("\n<HTML>\n<HEAD>\n <META NAME=\"GENERATOR\"", of); |
471 | fputs(" CONTENT=\"psiconv-" VERSION "\">\n", of); |
471 | fputs(" CONTENT=\"psiconv-" VERSION "\">\n", of); |
472 | |
472 | |
|
|
473 | if (wf->page_sec->header->text) { |
473 | if (psiconv_list_length(wf->page_sec->header->text->paragraphs) > 0) { |
474 | if (psiconv_list_length(wf->page_sec->header->text->paragraphs) > 0) { |
474 | fputs(" <TITLE>", of); |
475 | fputs(" <TITLE>", of); |
475 | para = psiconv_list_get(wf->page_sec->header->text->paragraphs, 0); |
476 | para = psiconv_list_get(wf->page_sec->header->text->paragraphs, 0); |
476 | i = 0; |
477 | i = 0; |
477 | fput_text(of, para->text, strlen(para->text), &i); |
478 | fput_text(of, para->text, strlen(para->text), &i); |
478 | fputs("</TITLE>\n", of); |
479 | fputs("</TITLE>\n", of); |
|
|
480 | } |
479 | } |
481 | } |
480 | |
482 | |
481 | normal = wf->styles_sec->normal; |
483 | normal = wf->styles_sec->normal; |
482 | fputs(" <STYLE TYPE=\"text/css\"><!--\n", of); |
484 | fputs(" <STYLE TYPE=\"text/css\"><!--\n", of); |
483 | fprintf(of," BODY { background-color: #%02x%02x%02x }\n", |
485 | fprintf(of," BODY { background-color: #%02x%02x%02x }\n", |
… | |
… | |
488 | for (i = 0; i < psiconv_list_length(wf->styles_sec->styles); i++) { |
490 | for (i = 0; i < psiconv_list_length(wf->styles_sec->styles); i++) { |
489 | sty = psiconv_list_get(wf->styles_sec->styles, i); |
491 | sty = psiconv_list_get(wf->styles_sec->styles, i); |
490 | fput_style(of, normal, sty, wf); |
492 | fput_style(of, normal, sty, wf); |
491 | } |
493 | } |
492 | fputs(" --></STYLE>\n</HEAD>\n<BODY>\n", of); |
494 | fputs(" --></STYLE>\n</HEAD>\n<BODY>\n", of); |
|
|
495 | if (wf->page_sec->header->text) { |
493 | for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { |
496 | for (i = 0; i < psiconv_list_length(wf->paragraphs); i++) { |
494 | para = psiconv_list_get(wf->paragraphs, i); |
497 | para = psiconv_list_get(wf->paragraphs, i); |
495 | fput_para(of, para, wf); |
498 | fput_para(of, para, wf); |
|
|
499 | } |
496 | } |
500 | } |
497 | fputs("</BODY>\n</HTML>\n", of); |
501 | fputs("</BODY>\n</HTML>\n", of); |
498 | |
502 | |
499 | return fclose(of); |
503 | return fclose(of); |
500 | } |
504 | } |