From: ben Date: Sat, 13 May 2006 14:36:15 +0000 (+0000) Subject: Now that we've got definitive metrics for the standard fonts, there's no need X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/commitdiff_plain/3600720b58a1c95c24c370ecc83e2586e0c91b7c 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. git-svn-id: svn://svn.tartarus.org/sgt/halibut@6683 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/bk_pdf.c b/bk_pdf.c index 034cff1..99ad908 100644 --- a/bk_pdf.c +++ b/bk_pdf.c @@ -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)