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 | |
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')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/dofont.c | 22 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/luafont.c | 52 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/luatexfont.h | 210 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/mapfile.c | 19 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/mapfile.h | 64 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/subfont.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/texfont.c | 20 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/texfont.h | 33 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/tfmofm.c | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/tounicode.c | 6 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writecff.c | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writeenc.c | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writefont.c | 54 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writet1.c | 3 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writettf.c | 5 |
15 files changed, 396 insertions, 113 deletions
diff --git a/Build/source/texk/web2c/luatexdir/font/dofont.c b/Build/source/texk/web2c/luatexdir/font/dofont.c index 7033dc7be0c..f8a41c90394 100644 --- a/Build/source/texk/web2c/luatexdir/font/dofont.c +++ b/Build/source/texk/web2c/luatexdir/font/dofont.c @@ -22,7 +22,7 @@ #include "luatex-api.h" static const char _svn_version[] = - "$Id: dofont.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/dofont.c $"; + "$Id: dofont.c 2321 2009-04-18 09:17:13Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/dofont.c $"; #define TIMERS 0 @@ -51,8 +51,7 @@ static char *font_error_message(pointer u, char *nom, scaled s) } static int -do_define_font(integer f, char *cnom, char *caire, scaled s, - integer natural_dir) +do_define_font(integer f, char *cnom, scaled s, integer natural_dir) { boolean res; /* was the callback successful? */ @@ -68,12 +67,7 @@ do_define_font(integer f, char *cnom, char *caire, scaled s, callback_id = callback_defined(define_font_callback); if (callback_id > 0) { - if (caire == NULL || strlen(caire) == 0) { - cnam = xstrdup(cnom); - } else { - cnam = xmalloc(strlen(cnom) + strlen(caire) + 2); - sprintf(cnam, "%s/%s", caire, cnom); - } + cnam = xstrdup(cnom); #if TIMERS gettimeofday(&tva, NULL); #endif @@ -122,7 +116,7 @@ do_define_font(integer f, char *cnom, char *caire, scaled s, } } } else if (callback_id==0) { - res = read_tfm_info(f, cnom, caire, s); + res = read_tfm_info(f, cnom, s); if (res) { set_hyphen_char(f, get_default_hyphen_char()); set_skew_char(f, get_default_skew_char()); @@ -141,7 +135,7 @@ do_define_font(integer f, char *cnom, char *caire, scaled s, } -int read_font_info(pointer u, strnumber nom, scaled s, integer natural_dir) +int read_font_info(pointer u, str_number nom, scaled s, integer natural_dir) { integer f; char *cnom; @@ -149,7 +143,7 @@ int read_font_info(pointer u, strnumber nom, scaled s, integer natural_dir) cnom = xstrdup(makecstring(nom)); f = new_font(); - if ((f = do_define_font(f, cnom, NULL, s, natural_dir))) { + if ((f = do_define_font(f, cnom, s, natural_dir))) { free(cnom); return f; } else { @@ -174,11 +168,11 @@ int read_font_info(pointer u, strnumber nom, scaled s, integer natural_dir) the |font_tables| array, and we could attempt to reuse those */ -int find_font_id(char *nom, char *aire, scaled s) +int find_font_id(char *nom, scaled s) { integer f; f = new_font(); - if ((f = do_define_font(f, nom, aire, s, -1))) { + if ((f = do_define_font(f, nom, s, -1))) { return f; } else { return 0; diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.c b/Build/source/texk/web2c/luatexdir/font/luafont.c index 0de7725c8dd..c3a8da06b16 100644 --- a/Build/source/texk/web2c/luatexdir/font/luafont.c +++ b/Build/source/texk/web2c/luatexdir/font/luafont.c @@ -23,12 +23,10 @@ #include "nodes.h" static const char _svn_version[] = - "$Id: luafont.c 2293 2009-04-15 16:55:18Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/luafont.c $"; + "$Id: luafont.c 2312 2009-04-17 15:43:13Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/luafont.c $"; #define noVERBOSE -#define SAVE_REF 1 - char *font_type_strings[] = { "unknown", "virtual", "real", NULL }; char *font_format_strings[] = { "unknown", "type1", "type3", "truetype", "opentype", NULL }; @@ -380,7 +378,7 @@ int font_to_lua(lua_State * L, int f) { int k; charinfo *co; - if (font_cache_id(f)) { + if (font_cache_id(f)>0) { /* fetch the table from the registry if it was saved there by font_from_lua() */ lua_rawgeti(L, LUA_REGISTRYINDEX, font_cache_id(f)); @@ -510,6 +508,13 @@ int font_to_lua(lua_State * L, int f) } } lua_setfield(L, -2, "characters"); + + if (font_cache_id(f)==0) { /* renew */ + integer r; + lua_pushvalue(L,-1); + r = luaL_ref(Luas, LUA_REGISTRYINDEX); /* pops the table */ + set_font_cache_id(f, r); + } return 1; } @@ -1428,6 +1433,18 @@ int font_from_lua(lua_State * L, int f) int ec; /* last char index */ char *s; integer *l_fonts = NULL; + integer save_ref = 1; /* unneeded, really */ + + /* will we save a cache of the luat table? */ + s = string_field(L, "cache", "yes"); + if (strcmp(s,"yes")==0) + save_ref=1; + else if (strcmp(s,"no")==0) + save_ref=-1; + else if (strcmp(s,"renew")==0) + save_ref=0; + free(s); + /* the table is at stack index -1 */ if (luaS_width_index == 0) @@ -1541,7 +1558,7 @@ int font_from_lua(lua_State * L, int f) if (strcmp(font_name(f), s) == 0) l_fonts[i] = f; else - l_fonts[i] = find_font_id(s, "", t); + l_fonts[i] = find_font_id(s, t); lua_settop(L, s_top); } else { pdftex_fail("Invalid local font in font %s!\n", font_name(f)); @@ -1647,12 +1664,13 @@ int font_from_lua(lua_State * L, int f) font_name(f)); } -#if SAVE_REF - r = luaL_ref(Luas, LUA_REGISTRYINDEX); /* pops the table */ - set_font_cache_id(f, r); -#else - lua_pop(Luas, 1); -#endif + if (save_ref>0) { + r = luaL_ref(Luas, LUA_REGISTRYINDEX); /* pops the table */ + set_font_cache_id(f, r); + } else { + lua_pop(Luas, 1); + set_font_cache_id(f, save_ref); + } } else { /* jikes, no characters */ pdftex_warn("lua-loaded font [%d] (%s) has no character table!", f, font_name(f)); @@ -1854,18 +1872,6 @@ static halfword handle_lig_nest(halfword root, halfword cur) } -static void print_disc(halfword cur) -{ - halfword n; - fprintf (stdout, "cur(%d,%d) {", cur, subtype(cur)); - n = vlink_pre_break(cur); show_node_list(n); - fprintf (stdout, "}{"); - n = vlink_post_break(cur); show_node_list(n); - fprintf (stdout, "}{"); - n = vlink_no_break(cur); show_node_list(n); - fprintf (stdout, "}\n"); -} - static halfword handle_lig_word(halfword cur) { halfword right = null; diff --git a/Build/source/texk/web2c/luatexdir/font/luatexfont.h b/Build/source/texk/web2c/luatexdir/font/luatexfont.h index c3a9e8aeada..554c981b1a8 100644 --- a/Build/source/texk/web2c/luatexdir/font/luatexfont.h +++ b/Build/source/texk/web2c/luatexdir/font/luatexfont.h @@ -1,5 +1,5 @@ -/* luatexfont.h General font functions - +/* luatexfont.h --- General font definitions + Copyright 2008 Taco Hoekwater <taco@luatex.org> This file is part of LuaTeX. @@ -17,51 +17,215 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: luatexfont.h 2271 2009-04-12 23:42:21Z oneiros $ */ +/* $Id: luatexfont.h 2332 2009-04-18 17:17:56Z hhenkel $ */ #ifndef LUATEXFONT_H -# define LUATEXFONT_H 1 +# define LUATEXFONT_H # include "ptexlib.h" -# include "sfnt.h" - -/* texfont.c */ -extern charinfo *copy_charinfo(charinfo * ci); +# ifndef pdfTeX +# define pdfTeX +# include "sfnt.h" /* which wants that pdfTeX is defined */ +# undef pdfTeX +# else +# include "sfnt.h" +# endif + +/**********************************************************************/ + +# define ASCENT_CODE 0 +# define CAPHEIGHT_CODE 1 +# define DESCENT_CODE 2 +# define ITALIC_ANGLE_CODE 3 +# define STEMV_CODE 4 +# define XHEIGHT_CODE 5 +# define FONTBBOX1_CODE 6 +# define FONTBBOX2_CODE 7 +# define FONTBBOX3_CODE 8 +# define FONTBBOX4_CODE 9 +# define FONTNAME_CODE 10 +# define GEN_KEY_NUM (XHEIGHT_CODE + 1) +# define MAX_KEY_CODE (FONTBBOX1_CODE + 1) +# define INT_KEYS_NUM (FONTBBOX4_CODE + 1) +# define FONT_KEYS_NUM (FONTNAME_CODE + 1) + +# define FD_FLAGS_NOT_SET_IN_MAPLINE -1 +# define FD_FLAGS_DEFAULT_EMBED 4 /* a symbol font */ +# define FD_FLAGS_DEFAULT_NON_EMBED 0x22 + /* a nonsymbolic serif font */ + +/**********************************************************************/ + +typedef struct { + const char *pdfname; + const char *t1name; + boolean valid; +} key_entry; + +extern const key_entry font_key[FONT_KEYS_NUM]; + +typedef struct _subfont_entry { + char *infix; /* infix for this subfont, eg "01" */ + long charcodes[256]; /* the mapping for this subfont as read from sfd */ + struct _subfont_entry *next; +} subfont_entry; + +# include "mapfile.h" + +typedef struct { + char *name; /* sfd name, eg "Unicode" */ + subfont_entry *subfont; /* linked list of subfonts */ +} sfd_entry; + +typedef struct { + int val; /* value */ + boolean set; /* true if parameter has been set */ +} intparm; + +typedef struct { + integer fe_objnum; /* object number */ + char *name; /* encoding file name */ + char **glyph_names; /* array of glyph names */ + struct avl_table *tx_tree; /* tree of encoding positions marked as used by TeX */ +} fe_entry; + +typedef struct fd_entry_ { + integer fd_objnum; /* object number of the font descriptor object */ + char *fontname; /* /FontName (without subset tag) */ + char *subset_tag; /* 6-character subset tag */ + boolean ff_found; + integer ff_objnum; /* object number of the font program stream */ + integer fn_objnum; /* font name object number (embedded PDF) */ + boolean all_glyphs; /* embed all glyphs? */ + boolean write_ttf_glyph_names; + intparm font_dim[FONT_KEYS_NUM]; + fe_entry *fe; /* pointer to encoding structure */ + char **builtin_glyph_names; /* builtin encoding as read from the Type1 font file */ + fm_entry *fm; /* pointer to font map structure */ + struct avl_table *tx_tree; /* tree of non-reencoded TeX characters marked as used */ + struct avl_table *gl_tree; /* tree of all marked glyphs */ +} fd_entry; + +typedef struct fo_entry_ { + integer fo_objnum; /* object number of the font dictionary */ + internalfontnumber tex_font; /* needed only for \pdffontattr{} */ + fm_entry *fm; /* pointer to font map structure for this font dictionary */ + fd_entry *fd; /* pointer to /FontDescriptor object structure */ + fe_entry *fe; /* pointer to encoding structure */ + integer cw_objnum; /* object number of the font program object */ + integer first_char; /* first character used in this font */ + integer last_char; /* last character used in this font */ + struct avl_table *tx_tree; /* tree of non-reencoded TeX characters marked as used */ + integer tounicode_objnum; /* object number of ToUnicode */ +} fo_entry; + +typedef struct { + char *name; /* glyph name */ + long code; /* -1 = undefined; -2 = multiple codes, stored + as string in unicode_seq; otherwise unicode value */ + char *unicode_seq; /* multiple unicode sequence */ +} glyph_unicode_entry; + +typedef struct glw_entry_ { /* subset glyphs for inclusion in CID-based fonts */ + unsigned int id; /* glyph CID */ + signed int wd; /* glyph width in 1/1000 em parts */ +} glw_entry; + +typedef struct { + integer charcode, cwidth, cheight, xoff, yoff, xescape, rastersize; + halfword *raster; +} chardesc; + +/**********************************************************************/ + +# include "texfont.h" /* tounicode.c */ -extern integer write_cid_tounicode(fo_entry * fo, internalfontnumber f); +integer write_cid_tounicode(fo_entry * fo, internalfontnumber f); +void glyph_unicode_free(void); +void def_tounicode(str_number, str_number); +integer write_tounicode(char **, char *); /* vfpacket.c */ -extern void replace_packet_fonts(internal_font_number f, integer * old_fontid, - integer * new_fontid, int count); -extern integer *packet_local_fonts(internal_font_number f, integer * num); +void replace_packet_fonts(internal_font_number f, integer * old_fontid, + integer * new_fontid, int count); +integer *packet_local_fonts(internal_font_number f, integer * num); /* writeccf.c */ -extern void writetype1w(fd_entry * fd); +void writetype1w(fd_entry * fd); /* writetype0.c */ -extern void writetype0(fd_entry * fd); +void writetype0(fd_entry * fd); + +/* writefont.c */ +void do_pdf_font(integer, internalfontnumber); +fd_entry *lookup_fd_entry(char *, integer, integer); +fd_entry *new_fd_entry(void); +void write_fontstuff(); +integer get_fd_objnum(fd_entry * fd); +integer get_fn_objnum(fd_entry * fd); +void embed_whole_font(fd_entry * fd); +void register_fd_entry(fd_entry * fd); + +/* writet1.c */ +boolean t1_subset(char *, char *, unsigned char *); +char **load_enc_file(char *); +void writet1(fd_entry *); +void t1_free(void); +extern integer t1_length1, t1_length2, t1_length3; /* writetype2.c */ -extern void writetype2(fd_entry * fd); +void writetype2(fd_entry * fd); extern unsigned long cidtogid_obj; -extern pdf_obj *pdf_new_stream(void); -extern void pdf_add_stream(pdf_obj * stream, unsigned char *buf, long len); -extern void pdf_release_obj(pdf_obj * stream); +pdf_obj *pdf_new_stream(void); +void pdf_add_stream(pdf_obj * stream, unsigned char *buf, long len); +void pdf_release_obj(pdf_obj * stream); + +/* subfont.c */ +void sfd_free(void); +boolean handle_subfont_fm(fm_entry *, int); + +/* writeenc.c */ +fe_entry *get_fe_entry(char *); +void enc_free(void); +void write_fontencodings(void); + +/* writettf.c */ +void writettf(fd_entry *); +void writeotf(fd_entry *); +void ttf_free(void); +extern integer ttf_length; + +/* pkin.c */ +int readchar(boolean, chardesc *); + +/* macnames.c */ +extern const char notdef[]; + +/* vfovf.c */ +void vf_expand_local_fonts(internal_font_number f); +internal_font_number letter_space_font(halfword u, internal_font_number f, + integer e); +internal_font_number auto_expand_font(internal_font_number f, integer e); +str_number expand_font_name(internal_font_number f, integer e); +void pdf_check_vf_cur_val(void); +internal_font_number copy_font_info(internal_font_number f); /* writet3.c */ extern FILE *t3_file; +void writet3(int, internalfontnumber); +scaled get_pk_char_width(internalfontnumber, scaled); extern unsigned char *t3_buffer; extern integer t3_size; extern integer t3_curbyte; -# define t3_read_file() readbinfile(t3_file,&t3_buffer,&t3_size) +# define t3_read_file() readbinfile(t3_file, &t3_buffer, &t3_size) # define t3_close() xfclose(t3_file, cur_file_name) # define t3_getchar() t3_buffer[t3_curbyte++] -# define t3_eof() (t3_curbyte>t3_size) +# define t3_eof() (t3_curbyte>t3_size) -# define t3_prefix(s) (!strncmp(t3_line_array, s, strlen(s))) -# define t3_putchar(c) pdfout(c) +# define t3_prefix(s) (!strncmp(t3_line_array, s, strlen(s))) +# define t3_putchar(c) pdfout(c) -#endif +#endif /* LUATEXFONT_H */ diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.c b/Build/source/texk/web2c/luatexdir/font/mapfile.c index 551ff59e49e..91ce21d60e3 100644 --- a/Build/source/texk/web2c/luatexdir/font/mapfile.c +++ b/Build/source/texk/web2c/luatexdir/font/mapfile.c @@ -26,7 +26,7 @@ #include "luatex-api.h" static const char _svn_version[] = - "$Id: mapfile.c 2271 2009-04-12 23:42:21Z oneiros $ " + "$Id: mapfile.c 2331 2009-04-18 16:39:50Z hhenkel $ " "$URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/mapfile.c $"; #define FM_BUF_SIZE 1024 @@ -44,6 +44,8 @@ static integer fm_curbyte = 0; #define fm_close() xfclose(fm_file, cur_file_name) #define fm_getchar() fm_buffer[fm_curbyte++] #define fm_eof() (fm_curbyte>fm_size) +#define is_cfg_comment(c) \ + (c == 10 || c == '*' || c == '#' || c == ';' || c == '%') typedef enum { FM_DUPIGNORE, FM_REPLACE, FM_DELETE } updatemode; typedef enum { MAPFILE, MAPLINE } maptype; @@ -136,6 +138,7 @@ struct avl_table *encname_tree = NULL; static int comp_fm_entry_tfm(const void *pa, const void *pb, void *p) { + (void) p; return strcmp(((const fm_entry *) pa)->tfm_name, ((const fm_entry *) pb)->tfm_name); } @@ -146,6 +149,7 @@ static int comp_fm_entry_ps(const void *pa, const void *pb, void *p) { int i; const fm_entry *p1 = (const fm_entry *) pa, *p2 = (const fm_entry *) pb; + (void) p; assert(p1->ps_name != NULL && p2->ps_name != NULL); if ((i = strcmp(p1->ps_name, p2->ps_name))) return i; @@ -158,6 +162,7 @@ static int comp_fm_entry_ps(const void *pa, const void *pb, void *p) static int comp_ff_entry(const void *pa, const void *pb, void *p) { + (void) p; return strcmp(((const ff_entry *) pa)->ff_name, ((const ff_entry *) pb)->ff_name); } @@ -884,7 +889,6 @@ void pdf_init_map_file(string map_name) mitem->line = map_name; } - /**********************************************************************/ /* * Early check whether a font file exists. Search tree ff_tree is used @@ -939,11 +943,20 @@ ff_entry *check_ff_exist(char *ff_name, boolean is_tt) } /**********************************************************************/ + +int is_subsetable(fm_entry * fm) +{ + assert(is_included(fm)); + return is_subsetted(fm); +} + +/**********************************************************************/ /* cleaning up... */ static void destroy_fm_entry_tfm(void *pa, void *pb) { fm_entry *fm; + (void) pb; fm = (fm_entry *) pa; if (!has_pslink(fm)) delete_fm_entry(fm); @@ -954,6 +967,7 @@ static void destroy_fm_entry_tfm(void *pa, void *pb) static void destroy_fm_entry_ps(void *pa, void *pb) { fm_entry *fm; + (void) pb; fm = (fm_entry *) pa; if (!has_tfmlink(fm)) delete_fm_entry(fm); @@ -964,6 +978,7 @@ static void destroy_fm_entry_ps(void *pa, void *pb) static void destroy_ff_entry(void *pa, void *pb) { ff_entry *ff; + (void) pb; ff = (ff_entry *) pa; delete_ff_entry(ff); } diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.h b/Build/source/texk/web2c/luatexdir/font/mapfile.h index e07c70047ec..e4242a21255 100644 --- a/Build/source/texk/web2c/luatexdir/font/mapfile.h +++ b/Build/source/texk/web2c/luatexdir/font/mapfile.h @@ -17,10 +17,68 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: mapfile.h 2271 2009-04-12 23:42:21Z oneiros $ */ +/* $Id: mapfile.h 2331 2009-04-18 16:39:50Z hhenkel $ */ #ifndef MAPFILE_H # define MAPFILE_H + +# define F_INCLUDED 0x01 +# define F_SUBSETTED 0x02 +# define F_STDT1FONT 0x04 +# define F_SUBFONT 0x08 +# define F_TYPE1 0x10 +# define F_TRUETYPE 0x20 +# define F_OTF 0x40 +# define F_CIDKEYED 0x80 + +# define set_included(fm) ((fm)->type |= F_INCLUDED) +# define set_subsetted(fm) ((fm)->type |= F_SUBSETTED) +# define set_std_t1font(fm) ((fm)->type |= F_STDT1FONT) +# define set_subfont(fm) ((fm)->type |= F_SUBFONT) +# define set_type1(fm) ((fm)->type |= F_TYPE1) +# define set_truetype(fm) ((fm)->type |= F_TRUETYPE) +# define set_opentype(fm) ((fm)->type |= F_OTF) +# define set_subfont(fm) ((fm)->type |= F_SUBFONT) +# define set_cidkeyed(fm) ((fm)->type |= F_CIDKEYED) + +# define unset_included(fm) ((fm)->type &= ~F_INCLUDED) +# define unset_subsetted(fm) ((fm)->type &= ~F_SUBSETTED) +# define unset_std_t1font(fm)((fm)->type &= ~F_STDT1FONT) +# define unset_subfont(fm) ((fm)->type &= ~F_SUBFONT) +# define unset_type1(fm) ((fm)->type &= ~F_TYPE1) +# define unset_truetype(fm) ((fm)->type &= ~F_TRUETYPE) +# define unset_opentype(fm) ((fm)->type &= ~F_OTF) +# define unset_subfont(fm) ((fm)->type &= ~F_SUBFONT) +# define unset_cidkeyed(fm) ((fm)->type &= ~F_CIDKEYED) + +# define is_included(fm) (((fm)->type & F_INCLUDED) != 0) +# define is_subsetted(fm) (((fm)->type & F_SUBSETTED) != 0) +# define is_std_t1font(fm) (((fm)->type & F_STDT1FONT) != 0) +# define is_subfont(fm) (((fm)->type & F_SUBFONT) != 0) +# define is_type1(fm) (((fm)->type & F_TYPE1) != 0) +# define is_truetype(fm) (((fm)->type & F_TRUETYPE) != 0) +# define is_opentype(fm) (((fm)->type & F_OTF) != 0) +# define is_subfont(fm) (((fm)->type & F_SUBFONT) != 0) +# define is_cidkeyed(fm) (((fm)->type & F_CIDKEYED) != 0) + +# define fm_slant(fm) (fm)->slant +# define fm_extend(fm) (fm)->extend +# define fm_fontfile(fm) (fm)->ff_name + +# define is_reencoded(fm) ((fm)->encname != NULL) +# define is_fontfile(fm) (fm_fontfile(fm) != NULL) +# define is_t1fontfile(fm) (is_fontfile(fm) && is_type1(fm)) +# define is_builtin(fm) (!is_fontfile(fm)) + +# define LINK_TFM 0x01 +# define LINK_PS 0x02 +# define set_tfmlink(fm) ((fm)->links |= LINK_TFM) +# define set_pslink(fm) ((fm)->links |= LINK_PS) +# define unset_tfmlink(fm) ((fm)->links &= ~LINK_TFM) +# define unset_pslink(fm) ((fm)->links &= ~LINK_PS) +# define has_tfmlink(fm) ((fm)->links & LINK_TFM) +# define has_pslink(fm) ((fm)->links & LINK_PS) + /**********************************************************************/ typedef struct { @@ -61,6 +119,6 @@ fm_entry *new_fm_entry(void); void delete_fm_entry(fm_entry *); int avl_do_entry(fm_entry *, int); int check_std_t1font(char *s); +int is_subsetable(fm_entry * fm); -/**********************************************************************/ -#endif +#endif /* MAPFILE_H */ diff --git a/Build/source/texk/web2c/luatexdir/font/subfont.c b/Build/source/texk/web2c/luatexdir/font/subfont.c index 33620092321..b7b90f2b01c 100644 --- a/Build/source/texk/web2c/luatexdir/font/subfont.c +++ b/Build/source/texk/web2c/luatexdir/font/subfont.c @@ -22,7 +22,7 @@ #include <string.h> static const char _svn_version[] = - "$Id: subfont.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/subfont.c $"; + "$Id: subfont.c 2306 2009-04-16 15:01:45Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/subfont.c $"; static struct avl_table *sfd_tree = NULL; @@ -69,6 +69,7 @@ static void destroy_sfd_entry(void *pa, void *pb) subfont_entry *p, *q; sfd_entry *sfd; sfd = (sfd_entry *) pa; + (void)pb; p = sfd->subfont; while (p != NULL) { q = p->next; @@ -81,6 +82,7 @@ static void destroy_sfd_entry(void *pa, void *pb) static int comp_sfd_entry(const void *pa, const void *pb, void *p) { + (void)p; return strcmp(((const sfd_entry *) pa)->name, ((const sfd_entry *) pb)->name); } diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.c b/Build/source/texk/web2c/luatexdir/font/texfont.c index 7eac52c7d06..17e4e49f5d1 100644 --- a/Build/source/texk/web2c/luatexdir/font/texfont.c +++ b/Build/source/texk/web2c/luatexdir/font/texfont.c @@ -35,7 +35,7 @@ #include "luatex-api.h" static const char _svn_version[] = - "$Id: texfont.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/texfont.c $"; + "$Id: texfont.c 2321 2009-04-18 09:17:13Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/texfont.c $"; #define proper_char_index(c) (c<=font_ec(f) && c>=font_bc(f)) #define dxfree(a,b) { xfree(a); a = b ; } @@ -135,10 +135,6 @@ integer new_font(void) return id; } -#define Charinfo_count(a) font_tables[a]->charinfo_count -#define Charinfo_size(a) font_tables[a]->charinfo_size -#define Characters(a) font_tables[a]->characters - #define find_charinfo_id(f,c) get_sa_item(font_tables[f]->characters,c) charinfo *get_charinfo(internal_font_number f, integer c) @@ -146,11 +142,11 @@ charinfo *get_charinfo(internal_font_number f, integer c) sa_tree_item glyph; charinfo *ci; if (proper_char_index(c)) { - glyph = get_sa_item(Characters(f), c); + glyph = get_sa_item(font_tables[f]->characters, c); if (!glyph) { glyph = ++font_tables[f]->charinfo_count; - if (glyph>=font_tables[f]->charinfo_size) { + if (glyph>=(unsigned)font_tables[f]->charinfo_size) { font_bytes += (16*sizeof(charinfo)); do_realloc(font_tables[f]->charinfo, (glyph + 16), charinfo); memset(&(font_tables[f]->charinfo[glyph]), 0, (16*sizeof(charinfo))); @@ -182,7 +178,7 @@ void set_charinfo(internal_font_number f, integer c, charinfo * ci) { sa_tree_item glyph; if (proper_char_index(c)) { - glyph = get_sa_item(Characters(f), c); + glyph = get_sa_item(font_tables[f]->characters, c); if (glyph) { font_tables[f]->charinfo[glyph] = *ci; } else { @@ -1074,11 +1070,11 @@ integer copy_font(integer f) memcpy(math_param_base(k), math_param_base(f), i); } - i = sizeof(charinfo) * (Charinfo_size(f) + 1); + i = sizeof(charinfo) * (font_tables[f]->charinfo_size + 1); font_bytes += i; font_tables[k]->charinfo = xmalloc(i); memset(font_tables[k]->charinfo, 0, i); - for (i = 0; i <= Charinfo_size(k); i++) { + for (i = 0; i < font_tables[k]->charinfo_size; i++) { ci = copy_charinfo(&font_tables[f]->charinfo[i]); font_tables[k]->charinfo[i] = *ci; } @@ -1158,7 +1154,7 @@ boolean is_valid_font(integer id) } /* return 1 == identical */ -boolean cmp_font_name(integer id, strnumber t) +boolean cmp_font_name(integer id, str_number t) { char *tid, *tt; if (!is_valid_font(id)) @@ -1172,7 +1168,7 @@ boolean cmp_font_name(integer id, strnumber t) return 1; } -boolean cmp_font_area(integer id, strnumber t) +boolean cmp_font_area(integer id, str_number t) { char *tt = NULL; char *tid = font_area(id); diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.h b/Build/source/texk/web2c/luatexdir/font/texfont.h index 8723364a96c..300135c0f35 100644 --- a/Build/source/texk/web2c/luatexdir/font/texfont.h +++ b/Build/source/texk/web2c/luatexdir/font/texfont.h @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */ -/* $Id: texfont.h 2271 2009-04-12 23:42:21Z oneiros $ */ +/* $Id: texfont.h 2331 2009-04-18 16:39:50Z hhenkel $ */ /* Here we have the interface to LuaTeX's font system, as seen from the main pascal program. There is a companion list in luatex.defines to @@ -28,7 +28,7 @@ */ #ifndef TEXFONT_H -# define TEXFONT_H 1 +# define TEXFONT_H # include "luatexdir/managed-sa.h" @@ -79,10 +79,10 @@ typedef struct charinfo { int top_right_math_kerns; int bottom_right_math_kerns; int bottom_left_math_kerns; - scaled *top_left_math_kern_array; - scaled *top_right_math_kern_array; - scaled *bottom_right_math_kern_array; - scaled *bottom_left_math_kern_array; + scaled *top_left_math_kern_array; + scaled *top_right_math_kern_array; + scaled *bottom_right_math_kern_array; + scaled *bottom_left_math_kern_array; } charinfo; @@ -221,14 +221,14 @@ extern char *font_embedding_strings[]; # define set_font_name(f,b) font_name(f) = b # define tex_font_name(a) maketexstring(font_name(a)) -boolean cmp_font_name(integer, strnumber); +boolean cmp_font_name(integer, str_number); # define font_area(a) font_tables[a]->_font_area # define get_font_area(a) (unsigned char *)font_area(a) # define set_font_area(f,b) font_area(f) = b # define tex_font_area(a) maketexstring(font_area(a)) -boolean cmp_font_area(integer, strnumber); +boolean cmp_font_area(integer, str_number); # define font_reassign(a,b) { if (a!=NULL) free(a); a = b; } @@ -406,7 +406,7 @@ typedef enum { top_right_kern = 1, bottom_right_kern = 2, bottom_left_kern = 3, - top_left_kern = 4 + top_left_kern = 4 } font_math_kern_codes; extern charinfo *get_charinfo(internal_font_number f, integer c); @@ -433,8 +433,9 @@ extern void set_charinfo_ef(charinfo * ci, scaled val); extern void set_charinfo_lp(charinfo * ci, scaled val); extern void set_charinfo_rp(charinfo * ci, scaled val); -extern void add_charinfo_math_kern(charinfo *ci, int type, scaled ht, scaled krn); -extern int get_charinfo_math_kerns(charinfo * ci, int id); +extern void add_charinfo_math_kern(charinfo * ci, int type, scaled ht, + scaled krn); +extern int get_charinfo_math_kerns(charinfo * ci, int id); # define set_char_used(f,a,b) do { \ if (char_exists(f,a)) \ @@ -568,13 +569,13 @@ extern void set_lp_code(internal_font_number f, integer c, integer i); extern void set_rp_code(internal_font_number f, integer c, integer i); extern void set_ef_code(internal_font_number f, integer c, integer i); -int read_tfm_info(internal_font_number f, char *nom, char *aire, scaled s); +int read_tfm_info(internal_font_number f, char *nom, scaled s); /* from dofont.c */ -extern int read_font_info(pointer u, strnumber nom, scaled s, integer ndir); -extern int find_font_id(char *nom, char *aire, scaled s); +extern int read_font_info(pointer u, str_number nom, scaled s, integer ndir); +extern int find_font_id(char *nom, scaled s); /* for and from vfpacket.c */ @@ -599,4 +600,6 @@ extern scaled sqxfw(scaled sq, integer fw); extern void do_vf_packet(internal_font_number vf_f, integer c); extern int vf_packet_bytes(charinfo * co); -#endif +charinfo *copy_charinfo(charinfo * ci); + +#endif /* TEXFONT_H */ diff --git a/Build/source/texk/web2c/luatexdir/font/tfmofm.c b/Build/source/texk/web2c/luatexdir/font/tfmofm.c index 2e373e71081..1172b457371 100644 --- a/Build/source/texk/web2c/luatexdir/font/tfmofm.c +++ b/Build/source/texk/web2c/luatexdir/font/tfmofm.c @@ -22,7 +22,7 @@ #include "luatexfont.h" static const char _svn_version[] = - "$Id: tfmofm.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/tfmofm.c $"; + "$Id: tfmofm.c 2306 2009-04-16 15:01:45Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/tfmofm.c $"; /* Here are some macros that help process ligatures and kerns */ @@ -376,7 +376,7 @@ additional parameter information, which is explained later. int -open_tfm_file(char *nom, char *aire, unsigned char **tfm_buf, integer * tfm_siz) +open_tfm_file(char *nom, unsigned char **tfm_buf, integer * tfm_siz) { boolean res; /* was the callback successful? */ boolean opened; /* was |tfm_file| successfully opened? */ @@ -531,7 +531,7 @@ typedef struct tfmcharacterinfo { unsigned char _tag; } tfmcharacterinfo; -int read_tfm_info(internalfontnumber f, char *cnom, char *caire, scaled s) +int read_tfm_info(internalfontnumber f, char *cnom, scaled s) { integer k; /* index into |font_info| */ halfword lf, lh, bc, ec, nw, nh, nd, ni, nl, nk, ne, np, slh; /* sizes of subfiles */ @@ -578,7 +578,7 @@ int read_tfm_info(internalfontnumber f, char *cnom, char *caire, scaled s) memset(&ci, 0, sizeof(tfmcharacterinfo)); - if (open_tfm_file(cnom, caire, &tfm_buffer, &tfm_size) != 1) + if (open_tfm_file(cnom, &tfm_buffer, &tfm_size) != 1) tfm_abort; /* cnom can be an absolute filename, xbasename() fixes that. */ diff --git a/Build/source/texk/web2c/luatexdir/font/tounicode.c b/Build/source/texk/web2c/luatexdir/font/tounicode.c index 31f07c9a253..ab448106e11 100644 --- a/Build/source/texk/web2c/luatexdir/font/tounicode.c +++ b/Build/source/texk/web2c/luatexdir/font/tounicode.c @@ -20,7 +20,7 @@ #include "ptexlib.h" static const char _svn_version[] = - "$Id: tounicode.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/tounicode.c $"; + "$Id: tounicode.c 2321 2009-04-18 09:17:13Z hhenkel $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/tounicode.c $"; #define isXdigit(c) (isdigit(c) || ('A' <= (c) && (c) <= 'F')) #define UNI_UNDEF -1 @@ -31,6 +31,7 @@ static struct avl_table *glyph_unicode_tree = NULL; static int comp_glyph_unicode_entry(const void *pa, const void *pb, void *p) { + (void)p; return strcmp(((const glyph_unicode_entry *) pa)->name, ((const glyph_unicode_entry *) pb)->name); } @@ -48,6 +49,7 @@ static glyph_unicode_entry *new_glyph_unicode_entry(void) static void destroy_glyph_unicode_entry(void *pa, void *pb) { glyph_unicode_entry *e = (glyph_unicode_entry *) pa; + (void)pb; xfree(e->name); if (e->code == UNI_STRING) { assert(e->unicode_seq != NULL); @@ -61,7 +63,7 @@ void glyph_unicode_free(void) avl_destroy(glyph_unicode_tree, destroy_glyph_unicode_entry); } -void def_tounicode(strnumber glyph, strnumber unistr) +void def_tounicode(str_number glyph, str_number unistr) { char buf[SMALL_BUF_SIZE], *p; char buf2[SMALL_BUF_SIZE], *q; diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.c b/Build/source/texk/web2c/luatexdir/font/writecff.c index d2b038785b0..8480122f6ce 100644 --- a/Build/source/texk/web2c/luatexdir/font/writecff.c +++ b/Build/source/texk/web2c/luatexdir/font/writecff.c @@ -22,7 +22,8 @@ #include "writecff.h" static const char _svn_version[] = - "$Id: writecff.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writecff.c $"; + "$Id: writecff.c 2331 2009-04-18 16:39:50Z hhenkel $ " + "$URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writecff.c $"; #define get_offset(s,n) get_unsigned(s, (n)) #define get_card8(a) a->stream[a->offset++] @@ -46,9 +47,9 @@ static unsigned long get_unsigned(cff_font * cff, int n) } #define CFF_ERROR pdftex_fail +#undef WARN #define WARN pdftex_warn - const char *const cff_stdstr[CFF_STDSTR_MAX] = { ".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", diff --git a/Build/source/texk/web2c/luatexdir/font/writeenc.c b/Build/source/texk/web2c/luatexdir/font/writeenc.c index 575d5b61c3d..70b6957951c 100644 --- a/Build/source/texk/web2c/luatexdir/font/writeenc.c +++ b/Build/source/texk/web2c/luatexdir/font/writeenc.c @@ -21,7 +21,7 @@ #include "ptexlib.h" static const char _svn_version[] = - "$Id: writeenc.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writeenc.c $"; + "$Id: writeenc.c 2306 2009-04-16 15:01:45Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writeenc.c $"; /**********************************************************************/ /* All encoding entries go into AVL tree for fast search by name. */ @@ -32,6 +32,7 @@ struct avl_table *fe_tree = NULL; static int comp_fe_entry(const void *pa, const void *pb, void *p) { + (void)p; return strcmp(((const fe_entry *) pa)->name, ((const fe_entry *) pb)->name); } @@ -164,6 +165,7 @@ static void destroy_fe_entry(void *pa, void *pb) { fe_entry *p; int i; + (void)pb; p = (fe_entry *) pa; xfree(p->name); if (p->glyph_names != NULL) 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); diff --git a/Build/source/texk/web2c/luatexdir/font/writet1.c b/Build/source/texk/web2c/luatexdir/font/writet1.c index 46563a6fb76..2832dbfae49 100644 --- a/Build/source/texk/web2c/luatexdir/font/writet1.c +++ b/Build/source/texk/web2c/luatexdir/font/writet1.c @@ -25,7 +25,7 @@ #include "luatex-api.h" static const char _svn_version[] = - "$Id: writet1.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writet1.c $"; + "$Id: writet1.c 2306 2009-04-16 15:01:45Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writet1.c $"; #define t1_log(str) if(tracefilenames) tex_printf("%s", str) #define get_length1() t1_length1 = t1_offset() - t1_save_offset @@ -1407,6 +1407,7 @@ static void cs_mark(const char *cs_name, int subr) static int comp_t1_glyphs(const void *pa, const void *pb, void *p) { + (void)p; return strcmp(*((const char **) pa), *((const char **) pb)); } diff --git a/Build/source/texk/web2c/luatexdir/font/writettf.c b/Build/source/texk/web2c/luatexdir/font/writettf.c index 6a989db833f..7781407c37b 100644 --- a/Build/source/texk/web2c/luatexdir/font/writettf.c +++ b/Build/source/texk/web2c/luatexdir/font/writettf.c @@ -23,7 +23,7 @@ #include <string.h> static const char _svn_version[] = - "$Id: writettf.c 2271 2009-04-12 23:42:21Z oneiros $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writettf.c $"; + "$Id: writettf.c 2306 2009-04-16 15:01:45Z taco $ $URL: http://scm.foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writettf.c $"; #define DEFAULT_NTABS 14 #define NEW_CMAP_SIZE 2 @@ -130,6 +130,7 @@ ttf_cmap_entry *new_ttf_cmap_entry(void) static void destroy_ttf_cmap_entry(void *pa, void *pb) { ttf_cmap_entry *p; + (void)pb; p = (ttf_cmap_entry *) pa; xfree(p->ttf_name); xfree(p->table); @@ -147,6 +148,7 @@ static int comp_ttf_cmap_entry(const void *pa, const void *pb, void *p) const ttf_cmap_entry *p1 = (const ttf_cmap_entry *) pa, *p2 = (const ttf_cmap_entry *) pb; int i; + (void)p; assert(p1->ttf_name != NULL && p2->ttf_name != NULL); if ((i = strcmp(p1->ttf_name, p2->ttf_name)) != 0) return i; @@ -1421,6 +1423,7 @@ void do_writeotf(fd_entry * fd) { long i; dirtab_entry *tab; + (void)fd; dir_tab = NULL; glyph_tab = NULL; if (tracefilenames) |