diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2009-04-22 15:09:21 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2009-04-22 15:09:21 +0000 |
commit | 27c36765240572fc41d9ca8c69b99e0a41493674 (patch) | |
tree | ad358e69f64f06096c79896dc3c88e80e658a913 /Build/source/texk/web2c/luatexdir/font/writefont.c | |
parent | 6619094417b7606acce5c62de157d426351d5775 (diff) |
import luatex 0.40.0
git-svn-id: svn://tug.org/texlive/trunk@12791 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/font/writefont.c')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writefont.c | 54 |
1 files changed, 45 insertions, 9 deletions
diff --git a/Build/source/texk/web2c/luatexdir/font/writefont.c b/Build/source/texk/web2c/luatexdir/font/writefont.c index b15b71489e8..74f1ffeeb14 100644 --- a/Build/source/texk/web2c/luatexdir/font/writefont.c +++ b/Build/source/texk/web2c/luatexdir/font/writefont.c @@ -22,12 +22,27 @@ #include "luatexfont.h" static const char _svn_version[] = - "$Id: writefont.c 2274 2009-04-13 12:10:20Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writefont.c $"; + "$Id: writefont.c 2331 2009-04-18 16:39:50Z hhenkel $ " + "$URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writefont.c $"; void write_cid_fontdictionary(fo_entry * fo, internalfontnumber f); void create_cid_fontdictionary(fm_entry * fm, integer font_objnum, internalfontnumber f); +const key_entry font_key[FONT_KEYS_NUM] = { + {"Ascent", "Ascender", 1} + , {"CapHeight", "CapHeight", 1} + , {"Descent", "Descender", 1} + , {"ItalicAngle", "ItalicAngle", 1} + , {"StemV", "StdVW", 1} + , {"XHeight", "XHeight", 1} + , {"FontBBox", "FontBBox", 1} + , {"", "", 0} + , {"", "", 0} + , {"", "", 0} + , {"FontName", "FontName", 1} +}; + /**********************************************************************/ struct avl_table *fo_tree = NULL; /* tree of font dictionaries */ @@ -35,6 +50,7 @@ struct avl_table *fd_tree = NULL; /* tree of font descriptor objects */ static int comp_fo_entry(const void *pa, const void *pb, void *p) { + (void) p; return strcmp(((const fo_entry *) pa)->fm->tfm_name, ((const fo_entry *) pb)->fm->tfm_name); } @@ -43,6 +59,7 @@ static int comp_fd_entry(const void *pa, const void *pb, void *p) { int i; const fd_entry *p1 = (const fd_entry *) pa, *p2 = (const fd_entry *) pb; + (void) p; assert(p1->fm != NULL && is_fontfile(p1->fm) && p2->fm != NULL && is_fontfile(p2->fm)); if ((i = strcmp(p1->fm->ff_name, p2->fm->ff_name)) != 0) @@ -262,6 +279,24 @@ void create_fontdescriptor(fo_entry * fo, internalfontnumber f) assert(fo->fd->gl_tree != NULL); } +integer get_fd_objnum(fd_entry * fd) +{ + assert(fd->fd_objnum != 0); + return fd->fd_objnum; +} + +integer get_fn_objnum(fd_entry * fd) +{ + if (fd->fn_objnum == 0) + fd->fn_objnum = pdf_new_objnum(); + return fd->fn_objnum; +} + +void embed_whole_font(fd_entry * fd) +{ + fd->all_glyphs = true; +} + /**********************************************************************/ /* * For all used characters of TeX font f, get corresponding glyph names @@ -713,18 +748,18 @@ void create_fontdictionary(fm_entry * fm, integer font_objnum, /**********************************************************************/ -static int has_ttf_outlines(fm_entry *fm) +static int has_ttf_outlines(fm_entry * fm) { - FILE *f = fopen(fm->ff_name,"rb"); - if (f!=NULL) { + FILE *f = fopen(fm->ff_name, "rb"); + if (f != NULL) { int ch1 = getc(f); int ch2 = getc(f); int ch3 = getc(f); int ch4 = getc(f); - fclose (f); - if (ch1=='O' && ch2=='T' && ch3=='T' && ch4=='O') - return 0; - return 1; + fclose(f); + if (ch1 == 'O' && ch2 == 'T' && ch3 == 'T' && ch4 == 'O') + return 0; + return 1; } return 0; } @@ -759,7 +794,7 @@ void do_pdf_font(integer font_objnum, internalfontnumber f) set_truetype(fm); } else { set_opentype(fm); - } + } break; case truetype_format: set_truetype(fm); @@ -807,6 +842,7 @@ void do_pdf_font(integer font_objnum, internalfontnumber f) int comp_glw_entry(const void *pa, const void *pb, void *p) { unsigned short i, j; + (void) p; i = (*(glw_entry *) pa).id; j = (*(glw_entry *) pb).id; cmp_return(i, j); |