diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2006-05-13 14:36:15 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2006-05-13 14:36:15 +0000 |
| commit | b45545bf362a30d958c17c4ea58eda573cc4a5b8 (patch) | |
| tree | 093eaf54a11082a67766d14eebbf7117cb2389f4 | |
| parent | 5b5984b6e6d762e288ed3b5a23114b1bc776c4a1 (diff) | |
| download | halibut-b45545bf362a30d958c17c4ea58eda573cc4a5b8.zip halibut-b45545bf362a30d958c17c4ea58eda573cc4a5b8.tar.gz halibut-b45545bf362a30d958c17c4ea58eda573cc4a5b8.tar.bz2 halibut-b45545bf362a30d958c17c4ea58eda573cc4a5b8.tar.xz | |
Now that we've got definitive metrics for the standard fonts, there's no need
to embed /FirstChar, /LastChar, /Widths or (soon) /FontDescriptor for them.
[originally from svn r6683]
| -rw-r--r-- | bk_pdf.c | 19 |
1 files changed, 18 insertions, 1 deletions
@@ -40,6 +40,8 @@ static void pdf_string_len(void (*add)(object *, char const *), static void objref(object *o, object *dest); static char *pdf_outline_convert(wchar_t *s, int *len); +static int is_std_font(char const *name); + static void make_pages_node(object *node, object *parent, page_data *first, page_data *last, object *resources, object *mediabox); @@ -162,7 +164,7 @@ void pdf_backend(paragraph *sourceform, keywordlist *keywords, objtext(font, "\n]\n>>\n"); - { + if (!is_std_font(fe->font->info->name)){ object *widths = new_object(&olist); int firstchar = -1, lastchar = -1; char buf[80]; @@ -548,6 +550,21 @@ static void objref(object *o, object *dest) rdaddsc(&o->main, buf); } +static char const * const stdfonts[] = { + "Times-Roman", "Times-Bold", "Times-Italic", "Times-BoldItalic", + "Helvetica", "Helvetica-Bold", "Helvetica-Oblique","Helvetica-BoldOblique", + "Courier", "Courier-Bold", "Courier-Oblique", "Courier-BoldOblique", + "Symbol", "ZapfDingbats" +}; + +static int is_std_font(char const *name) { + unsigned i; + for (i = 0; i < lenof(stdfonts); i++) + if (strcmp(name, stdfonts[i]) == 0) + return TRUE; + return FALSE; +} + static void make_pages_node(object *node, object *parent, page_data *first, page_data *last, object *resources, object *mediabox) |