diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2014-03-15 12:21:15 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2014-03-15 12:21:15 +0000 |
commit | a22d9897afbabdd07f13d2bc5c7c5b9c5865ab53 (patch) | |
tree | 70829ffa23329ca4c04efa8da7a18cfe9c44a1f4 /Build/source/texk/web2c/luatexdir/font | |
parent | 5909dbd7ee4290cc486c9c12e4ef0b2bfb9067d4 (diff) |
here is luatex 0.79.0
git-svn-id: svn://tug.org/texlive/trunk@33180 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/font')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/luafont.w | 591 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/luatexfont.h | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/mapfile.w | 30 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/pkin.w | 18 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/sfnt.h | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/subfont.w | 16 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/texfont.w | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/tounicode.w | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/vfovf.w | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writecff.w | 22 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writefont.w | 12 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writet1.w | 62 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writet3.w | 8 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writettf.w | 54 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writetype0.w | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writetype2.w | 10 |
16 files changed, 361 insertions, 494 deletions
diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.w b/Build/source/texk/web2c/luatexdir/font/luafont.w index 5d8e3030859..c64f6544ecb 100644 --- a/Build/source/texk/web2c/luatexdir/font/luafont.w +++ b/Build/source/texk/web2c/luatexdir/font/luafont.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: luafont.w 4679 2013-12-19 15:47:53Z luigi $" + "$Id: luafont.w 4847 2014-03-05 18:13:17Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/luafont.w $"; #include "ptexlib.h" @@ -584,40 +584,56 @@ static void append_float(eight_bits ** cpp, float a) *cpp = cp; } -#define lua_roundnumber(a,b) (int)floor((double)lua_tonumber(L,-1)+0.5) - -static int numeric_field(lua_State * L, const char *name, int dflt) -{ - int i = dflt; - lua_pushstring(L, name); - lua_rawget(L, -2); - if (lua_isnumber(L, -1)) { - i = lua_roundnumber(L, -1); - } - lua_pop(L, 1); - return i; -} - -static int n_numeric_field(lua_State * L, int name_index, int dflt) -{ - register int i = dflt; - lua_rawgeti(L, LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */ - lua_rawget(L, -2); - if (lua_type(L, -1) == LUA_TNUMBER) { - i = lua_roundnumber(L, -1); - } - lua_pop(L, 1); - return i; -} - - -static int enum_field(lua_State * L, const char *name, int dflt, +//#define lua_roundnumber(a,b) (int)floor((double)lua_tonumber(L,-1)+0.5) + + +/* static int n_numeric_field(lua_State * L, int name_index, int dflt) */ +/* { */ +/* register int i = dflt; */ +/* lua_rawgeti(L, LUA_REGISTRYINDEX, name_index); /\* fetch the stringptr *\/ */ +/* lua_rawget(L, -2); */ +/* if (lua_type(L, -1) == LUA_TNUMBER) { */ +/* i = lua_roundnumber(L, -1); */ +/* } */ +/* lua_pop(L, 1); */ +/* return i; */ +/* } */ + + + + +/* static int enum_field(lua_State * L, const char *name, int dflt, */ +/* const char **values) */ +/* { */ +/* int k; */ +/* const char *s; */ +/* int i = dflt; */ +/* lua_pushstring(L, name); */ +/* lua_rawget(L, -2); */ +/* if (lua_isnumber(L, -1)) { */ +/* i=(int)lua_tonumber(L, -1); */ +/* } else if (lua_isstring(L, -1)) { */ +/* s = lua_tostring(L, -1); */ +/* k = 0; */ +/* while (values[k] != NULL) { */ +/* if (strcmp(values[k], s) == 0) { */ +/* i = k; */ +/* break; */ +/* } */ +/* k++; */ +/* } */ +/* } */ +/* lua_pop(L, 1); */ +/* return i; */ +/* } */ + +static int n_enum_field(lua_State * L, int name_index, int dflt, const char **values) { int k; const char *s; int i = dflt; - lua_pushstring(L, name); + lua_rawgeti(L, LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */ lua_rawget(L, -2); if (lua_isnumber(L, -1)) { i=(int)lua_tonumber(L, -1); @@ -636,17 +652,19 @@ static int enum_field(lua_State * L, const char *name, int dflt, return i; } -static int boolean_field(lua_State * L, const char *name, int dflt) -{ - int i = dflt; - lua_pushstring(L, name); - lua_rawget(L, -2); - if (lua_isboolean(L, -1)) { - i = lua_toboolean(L, -1); - } - lua_pop(L, 1); - return i; -} + + +/* static int boolean_field(lua_State * L, const char *name, int dflt) */ +/* { */ +/* int i = dflt; */ +/* lua_pushstring(L, name); */ +/* lua_rawget(L, -2); */ +/* if (lua_isboolean(L, -1)) { */ +/* i = lua_toboolean(L, -1); */ +/* } */ +/* lua_pop(L, 1); */ +/* return i; */ +/* } */ static int n_boolean_field(lua_State * L, int name_index, int dflt) { @@ -661,23 +679,7 @@ static int n_boolean_field(lua_State * L, int name_index, int dflt) } -static char *string_field(lua_State * L, const char *name, const char *dflt) -{ - char *i; - lua_pushstring(L, name); - lua_rawget(L, -2); - if (lua_isstring(L, -1)) { - i = xstrdup(lua_tostring(L, -1)); - } else if (dflt == NULL) { - i = NULL; - } else { - i = xstrdup(dflt); - } - lua_pop(L, 1); - return i; -} - -static char *n_string_field(lua_State * L, int name_index, char *dflt) +static char *n_string_field_copy(lua_State * L, int name_index, const char *dflt) { char *i; lua_rawgeti(L, LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */ @@ -693,138 +695,13 @@ static char *n_string_field(lua_State * L, int name_index, char *dflt) return i; } -#define init_luaS_index(a) do { \ - lua_pushliteral(L,#a); \ - luaS_##a##_ptr = lua_tostring(L,-1); \ - luaS_##a##_index = luaL_ref (L,LUA_REGISTRYINDEX); \ - } while (0) - -#define make_luaS_index(a) \ - static int luaS_##a##_index = 0; \ - static const char * luaS_##a##_ptr = NULL - -#define luaS_index(a) luaS_##a##_index - -#define luaS_ptr_eq(a,b) (a==luaS_##b##_ptr) - -make_luaS_index(width); -make_luaS_index(height); -make_luaS_index(depth); -make_luaS_index(italic); -make_luaS_index(top_accent); -make_luaS_index(bot_accent); -make_luaS_index(index); -make_luaS_index(left_protruding); -make_luaS_index(right_protruding); -make_luaS_index(expansion_factor); -make_luaS_index(top); -make_luaS_index(bot); -make_luaS_index(rep); -make_luaS_index(mid); -make_luaS_index(next); -make_luaS_index(used); -make_luaS_index(name); -make_luaS_index(tounicode); -make_luaS_index(font); -make_luaS_index(char); -make_luaS_index(slot); -make_luaS_index(comment); -make_luaS_index(nop); -make_luaS_index(push); -make_luaS_index(pop); -make_luaS_index(rule); -make_luaS_index(right); -make_luaS_index(node); -make_luaS_index(down); -make_luaS_index(special); -make_luaS_index(image); -make_luaS_index(slant); -make_luaS_index(space); -make_luaS_index(space_stretch); -make_luaS_index(space_shrink); -make_luaS_index(x_height); -make_luaS_index(quad); -make_luaS_index(extra_space); -make_luaS_index(left_boundary); -make_luaS_index(right_boundary); -make_luaS_index(kerns); -make_luaS_index(ligatures); -make_luaS_index(fonts); -make_luaS_index(extender); -make_luaS_index(start); -make_luaS_index(end); -make_luaS_index(advance); -make_luaS_index(glyph); -make_luaS_index(extensible); -make_luaS_index(horiz_variants); -make_luaS_index(vert_variants); -make_luaS_index(mathkern); -make_luaS_index(commands); -make_luaS_index(scale); -make_luaS_index(lua); - -static void init_font_string_pointers(lua_State * L) +static const char *n_string_field(lua_State * L, int name_index) { - init_luaS_index(width); - init_luaS_index(height); - init_luaS_index(depth); - init_luaS_index(italic); - init_luaS_index(top_accent); - init_luaS_index(bot_accent); - init_luaS_index(index); - init_luaS_index(left_protruding); - init_luaS_index(right_protruding); - init_luaS_index(expansion_factor); - init_luaS_index(top); - init_luaS_index(bot); - init_luaS_index(rep); - init_luaS_index(mid); - init_luaS_index(next); - init_luaS_index(used); - init_luaS_index(name); - init_luaS_index(tounicode); - init_luaS_index(font); - init_luaS_index(char); - init_luaS_index(slot); - init_luaS_index(comment); - init_luaS_index(nop); - init_luaS_index(push); - init_luaS_index(pop); - init_luaS_index(rule); - init_luaS_index(right); - init_luaS_index(node); - init_luaS_index(down); - init_luaS_index(special); - init_luaS_index(image); - - init_luaS_index(slant); - init_luaS_index(space); - init_luaS_index(space_stretch); - init_luaS_index(space_shrink); - init_luaS_index(x_height); - init_luaS_index(quad); - init_luaS_index(extra_space); - - init_luaS_index(left_boundary); - init_luaS_index(right_boundary); - init_luaS_index(kerns); - init_luaS_index(ligatures); - init_luaS_index(fonts); - - init_luaS_index(extender); - init_luaS_index(start); - init_luaS_index(end); - init_luaS_index(advance); - init_luaS_index(glyph); - - init_luaS_index(extensible); - init_luaS_index(horiz_variants); - init_luaS_index(vert_variants); - init_luaS_index(mathkern); - init_luaS_index(commands); - init_luaS_index(scale); - init_luaS_index(lua); + lua_rawgeti(L, LUA_REGISTRYINDEX, name_index); /* fetch the stringptr */ + lua_rawget(L, -2); + return lua_tostring(L,-1); } +/*static void init_font_string_pointers(lua_State * L){}*/ static int count_char_packet_bytes(lua_State * L) { @@ -837,30 +714,30 @@ static int count_char_packet_bytes(lua_State * L) lua_rawgeti(L, -1, 1); if (lua_isstring(L, -1)) { const char *s = lua_tostring(L, -1); - if (luaS_ptr_eq(s, font)) { + if (lua_key_eq(s, font)) { l += 5; ff = 1; - } else if (luaS_ptr_eq(s, char)) { + } else if (lua_key_eq(s, char)) { if (ff == 0) { l += 5; } l += 5; ff = 1; - } else if (luaS_ptr_eq(s, slot)) { + } else if (lua_key_eq(s, slot)) { l += 10; ff = 1; - } else if (luaS_ptr_eq(s, comment) || luaS_ptr_eq(s, nop)) { + } else if (lua_key_eq(s, comment) || lua_key_eq(s, nop)) { ; - } else if (luaS_ptr_eq(s, push) || luaS_ptr_eq(s, pop)) { + } else if (lua_key_eq(s, push) || lua_key_eq(s, pop)) { l++; - } else if (luaS_ptr_eq(s, rule)) { + } else if (lua_key_eq(s, rule)) { l += 9; - } else if (luaS_ptr_eq(s, right) || luaS_ptr_eq(s, node) - || luaS_ptr_eq(s, down) || luaS_ptr_eq(s, image)) { + } else if (lua_key_eq(s, right) || lua_key_eq(s, node) + || lua_key_eq(s, down) || lua_key_eq(s, image)) { l += 5; - } else if (luaS_ptr_eq(s, scale)) { + } else if (lua_key_eq(s, scale)) { l += sizeof(float) + 1; - } else if (luaS_ptr_eq(s, special) || luaS_ptr_eq(s, lua)) { + } else if (lua_key_eq(s, special) || lua_key_eq(s, lua)) { size_t len; lua_rawgeti(L, -2, 2); if (lua_isstring(L, -1)) { @@ -922,16 +799,16 @@ read_char_packets(lua_State * L, int *l_fonts, charinfo * co, int atsize) if (lua_isstring(L, -1)) { s = lua_tostring(L, -1); cmd = 0; - if (luaS_ptr_eq(s, font)) { + if (lua_key_eq(s, font)) { cmd = packet_font_code; - } else if (luaS_ptr_eq(s, char)) { + } else if (lua_key_eq(s, char)) { cmd = packet_char_code; if (ff == 0) { append_packet(packet_font_code); ff = l_fonts[1]; do_store_four(ff); } - } else if (luaS_ptr_eq(s, slot)) { + } else if (lua_key_eq(s, slot)) { cmd = packet_nop_code; lua_rawgeti(L, -2, 2); n = (int) luaL_checkinteger(L, -1); @@ -943,27 +820,27 @@ read_char_packets(lua_State * L, int *l_fonts, charinfo * co, int atsize) do_store_four(ff); append_packet(packet_char_code); do_store_four(n); - } else if (luaS_ptr_eq(s, comment) || luaS_ptr_eq(s, nop)) { + } else if (lua_key_eq(s, comment) || lua_key_eq(s, nop)) { cmd = packet_nop_code; - } else if (luaS_ptr_eq(s, node)) { + } else if (lua_key_eq(s, node)) { cmd = packet_node_code; - } else if (luaS_ptr_eq(s, push)) { + } else if (lua_key_eq(s, push)) { cmd = packet_push_code; - } else if (luaS_ptr_eq(s, pop)) { + } else if (lua_key_eq(s, pop)) { cmd = packet_pop_code; - } else if (luaS_ptr_eq(s, rule)) { + } else if (lua_key_eq(s, rule)) { cmd = packet_rule_code; - } else if (luaS_ptr_eq(s, right)) { + } else if (lua_key_eq(s, right)) { cmd = packet_right_code; - } else if (luaS_ptr_eq(s, down)) { + } else if (lua_key_eq(s, down)) { cmd = packet_down_code; - } else if (luaS_ptr_eq(s, special)) { + } else if (lua_key_eq(s, special)) { cmd = packet_special_code; - } else if (luaS_ptr_eq(s, image)) { + } else if (lua_key_eq(s, image)) { cmd = packet_image_code; - } else if (luaS_ptr_eq(s, scale)) { + } else if (lua_key_eq(s, scale)) { cmd = packet_scale_code; - } else if (luaS_ptr_eq(s, lua)) { + } else if (lua_key_eq(s, lua)) { cmd = packet_lua_code; } @@ -1071,15 +948,16 @@ static void read_lua_cidinfo(lua_State * L, int f) { int i; char *s; - lua_getfield(L, -1, "cidinfo"); + //lua_getfield(L, -1, "cidinfo"); + lua_key_rawgeti(cidinfo); if (lua_istable(L, -1)) { - i = numeric_field(L, "version", 0); + i = lua_numeric_field_by_index(L,lua_key_index(version), 0); set_font_cidversion(f, i); - i = numeric_field(L, "supplement", 0); + i = lua_numeric_field_by_index(L,lua_key_index(supplement), 0); set_font_cidsupplement(f, i); - s = string_field(L, "registry", "Adobe"); /* Adobe-Identity-0 */ + s = n_string_field_copy(L, lua_key_index(registry), "Adobe"); /* Adobe-Identity-0 */ set_font_cidregistry(f, s); - s = string_field(L, "ordering", "Identity"); + s = n_string_field_copy(L, lua_key_index(ordering), "Identity"); set_font_cidordering(f, s); } lua_pop(L, 1); @@ -1091,7 +969,8 @@ static void read_lua_parameters(lua_State * L, int f) { int i, n; const char *s; - lua_getfield(L, -1, "parameters"); + //lua_getfield(L, -1, "parameters"); + lua_key_rawgeti(parameters); if (lua_istable(L, -1)) { /* the number of parameters is the max(IntegerKeys(L)),7) */ n = 7; @@ -1126,19 +1005,19 @@ static void read_lua_parameters(lua_State * L, int f) } else if (lua_isstring(L, -2)) { s = lua_tostring(L, -2); n = (lua_isnumber(L, -1) ? lua_roundnumber(L, -1) : 0); - if (luaS_ptr_eq(s, slant)) { + if (lua_key_eq(s, slant)) { set_font_param(f, slant_code, n); - } else if (luaS_ptr_eq(s, space)) { + } else if (lua_key_eq(s, space)) { set_font_param(f, space_code, n); - } else if (luaS_ptr_eq(s, space_stretch)) { + } else if (lua_key_eq(s, space_stretch)) { set_font_param(f, space_stretch_code, n); - } else if (luaS_ptr_eq(s, space_shrink)) { + } else if (lua_key_eq(s, space_shrink)) { set_font_param(f, space_shrink_code, n); - } else if (luaS_ptr_eq(s, x_height)) { + } else if (lua_key_eq(s, x_height)) { set_font_param(f, x_height_code, n); - } else if (luaS_ptr_eq(s, quad)) { + } else if (lua_key_eq(s, quad)) { set_font_param(f, quad_code, n); - } else if (luaS_ptr_eq(s, extra_space)) { + } else if (lua_key_eq(s, extra_space)) { set_font_param(f, extra_space_code, n); } } @@ -1153,7 +1032,8 @@ static void read_lua_parameters(lua_State * L, int f) static void read_lua_math_parameters(lua_State * L, int f) { int i = 0, n = 0; - lua_getfield(L, -1, "MathConstants"); + //lua_getfield(L, -1, "MathConstants"); + lua_key_rawgeti(MathConstants); if (lua_istable(L, -1)) { lua_pushnil(L); while (lua_next(L, -2) != 0) { @@ -1176,36 +1056,24 @@ static void read_lua_math_parameters(lua_State * L, int f) #define MIN_INF -0x7FFFFFFF -static void store_math_kerns(lua_State * L, charinfo * co, int id) +static void store_math_kerns(lua_State * L, int index, charinfo * co, int id) { - int l, k, i; + int l, k; scaled ht, krn; + lua_rawgeti(L, LUA_REGISTRYINDEX, index);lua_rawget(L, -2); if (lua_istable(L, -1) && ((k = (int) lua_rawlen(L, -1)) > 0)) { for (l = 0; l < k; l++) { lua_rawgeti(L, -1, (l + 1)); if (lua_istable(L, -1)) { - lua_getfield(L, -1, "height"); - if (lua_isnumber(L, -1)) { - i=(int)lua_tonumber(L, -1); - ht = (scaled) i; - } else { - ht = MIN_INF; - } - lua_pop(L, 1); - lua_getfield(L, -1, "kern"); - if (lua_isnumber(L, -1)) { - i=(int)lua_tonumber(L, -1); - krn = (scaled) i; - } else { - krn = MIN_INF; - } - lua_pop(L, 1); + ht = (scaled) lua_numeric_field_by_index(L, lua_key_index(height), MIN_INF); + krn = (scaled) lua_numeric_field_by_index(L, lua_key_index(kern), MIN_INF); if (krn > MIN_INF && ht > MIN_INF) add_charinfo_math_kern(co, id, ht, krn); } lua_pop(L, 1); } } + lua_pop(L, 1); } @ @c @@ -1226,66 +1094,69 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, if (lua_istable(L, -1)) { co = get_charinfo(f, i); set_charinfo_tag(co, 0); - j = n_numeric_field(L, luaS_width_index, 0); + j = lua_numeric_field_by_index(L, lua_key_index(width), 0); set_charinfo_width(co, j); - j = n_numeric_field(L, luaS_height_index, 0); + j = lua_numeric_field_by_index(L, lua_key_index(height), 0); set_charinfo_height(co, j); - j = n_numeric_field(L, luaS_depth_index, 0); + j = lua_numeric_field_by_index(L, lua_key_index(depth), 0); set_charinfo_depth(co, j); - j = n_numeric_field(L, luaS_italic_index, 0); + j = lua_numeric_field_by_index(L, lua_key_index(italic), 0); set_charinfo_italic(co, j); - j = n_numeric_field(L, luaS_index_index, 0); + j = lua_numeric_field_by_index(L, lua_key_index(index), 0); set_charinfo_index(co, j); - j = n_numeric_field(L, luaS_expansion_factor_index, 0); + j = lua_numeric_field_by_index(L, lua_key_index(expansion_factor), 0); set_charinfo_ef(co, j); - j = n_numeric_field(L, luaS_left_protruding_index, 0); + j = lua_numeric_field_by_index(L, lua_key_index(left_protruding), 0); set_charinfo_lp(co, j); - j = n_numeric_field(L, luaS_right_protruding_index, 0); + j = lua_numeric_field_by_index(L, lua_key_index(right_protruding), 0); set_charinfo_rp(co, j); - k = n_boolean_field(L, luaS_used_index, 0); + k = n_boolean_field(L, lua_key_index(used), 0); set_charinfo_used(co, k); - s = n_string_field(L, luaS_name_index, NULL); + s = n_string_field(L, lua_key_index(name)); if (s != NULL) set_charinfo_name(co, xstrdup(s)); else set_charinfo_name(co, NULL); - s = n_string_field(L, luaS_tounicode_index, NULL); + /* n_string_field leaves a value on stack*/ + lua_pop(L,1); + s = n_string_field(L, lua_key_index(tounicode)); if (s != NULL) set_charinfo_tounicode(co, xstrdup(s)); else set_charinfo_tounicode(co, NULL); - + /* n_string_field leaves a value on stack*/ + lua_pop(L,1); if (has_math) { - j = n_numeric_field(L, luaS_top_accent_index, INT_MIN); + j = lua_numeric_field_by_index(L, lua_key_index(top_accent), INT_MIN); set_charinfo_top_accent(co, j); - j = n_numeric_field(L, luaS_bot_accent_index, INT_MIN); + j = lua_numeric_field_by_index(L, lua_key_index(bot_accent), INT_MIN); set_charinfo_bot_accent(co, j); - k = n_numeric_field(L, luaS_next_index, -1); + k = lua_numeric_field_by_index(L, lua_key_index(next), -1); if (k >= 0) { set_charinfo_tag(co, list_tag); set_charinfo_remainder(co, k); } - lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_extensible_index); + lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(extensible)); lua_rawget(L, -2); if (lua_istable(L, -1)) { int top, bot, mid, rep; - top = n_numeric_field(L, luaS_top_index, 0); - bot = n_numeric_field(L, luaS_bot_index, 0); - mid = n_numeric_field(L, luaS_mid_index, 0); - rep = n_numeric_field(L, luaS_rep_index, 0); + top = lua_numeric_field_by_index(L, lua_key_index(top), 0); + bot = lua_numeric_field_by_index(L, lua_key_index(bot), 0); + mid = lua_numeric_field_by_index(L, lua_key_index(mid), 0); + rep = lua_numeric_field_by_index(L, lua_key_index(rep), 0); if (top != 0 || bot != 0 || mid != 0 || rep != 0) { set_charinfo_tag(co, ext_tag); set_charinfo_extensible(co, top, bot, mid, rep); } else { - pdftex_warn + luatex_warn ("lua-loaded font %s char [U+%X] has an invalid extensible field!", font_name(f), (int) i); } } lua_pop(L, 1); - lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_horiz_variants_index); + lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(horiz_variants)); lua_rawget(L, -2); if (lua_istable(L, -1)) { int glyph, startconnect, endconnect, advance, extender; @@ -1295,11 +1166,11 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, for (k = 1;; k++) { lua_rawgeti(L, -1, k); if (lua_istable(L, -1)) { - glyph = n_numeric_field(L, luaS_glyph_index, 0); - extender = n_numeric_field(L, luaS_extender_index, 0); - startconnect = n_numeric_field(L, luaS_start_index, 0); - endconnect = n_numeric_field(L, luaS_end_index, 0); - advance = n_numeric_field(L, luaS_advance_index, 0); + glyph = lua_numeric_field_by_index(L, lua_key_index(glyph), 0); + extender = lua_numeric_field_by_index(L, lua_key_index(extender), 0); + startconnect = lua_numeric_field_by_index(L, lua_key_index(start), 0); + endconnect = lua_numeric_field_by_index(L, lua_key_index(end), 0); + advance = lua_numeric_field_by_index(L, lua_key_index(advance), 0); h = new_variant(glyph, startconnect, endconnect, advance, extender); add_charinfo_hor_variant(co, h); @@ -1312,7 +1183,7 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, } lua_pop(L, 1); - lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_vert_variants_index); + lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(vert_variants)); lua_rawget(L, -2); if (lua_istable(L, -1)) { int glyph, startconnect, endconnect, advance, extender; @@ -1322,11 +1193,11 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, for (k = 1;; k++) { lua_rawgeti(L, -1, k); if (lua_istable(L, -1)) { - glyph = n_numeric_field(L, luaS_glyph_index, 0); - extender = n_numeric_field(L, luaS_extender_index, 0); - startconnect = n_numeric_field(L, luaS_start_index, 0); - endconnect = n_numeric_field(L, luaS_end_index, 0); - advance = n_numeric_field(L, luaS_advance_index, 0); + glyph = lua_numeric_field_by_index(L, lua_key_index(glyph), 0); + extender = lua_numeric_field_by_index(L, lua_key_index(extender), 0); + startconnect = lua_numeric_field_by_index(L, lua_key_index(start), 0); + endconnect = lua_numeric_field_by_index(L, lua_key_index(end), 0); + advance = lua_numeric_field_by_index(L, lua_key_index(advance), 0); h = new_variant(glyph, startconnect, endconnect, advance, extender); add_charinfo_vert_variant(co, h); @@ -1348,29 +1219,21 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, |["top_right"] ={ { ["height"]=676, ["kern"]=115 }, { ["height"]=776, ["kern"]=45 } },| |}| */ - lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_mathkern_index); + lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(mathkern)); lua_rawget(L, -2); if (lua_istable(L, -1)) { - lua_getfield(L, -1, "top_left"); - store_math_kerns(L, co, top_left_kern); - lua_pop(L, 1); - lua_getfield(L, -1, "top_right"); - store_math_kerns(L, co, top_right_kern); - lua_pop(L, 1); - lua_getfield(L, -1, "bottom_right"); - store_math_kerns(L, co, bottom_right_kern); - lua_pop(L, 1); - lua_getfield(L, -1, "bottom_left"); - store_math_kerns(L, co, bottom_left_kern); - lua_pop(L, 1); + store_math_kerns(L,lua_key_index(top_left), co, top_left_kern); + store_math_kerns(L,lua_key_index(top_right), co, top_right_kern); + store_math_kerns(L,lua_key_index(bottom_right), co, bottom_right_kern); + store_math_kerns(L,lua_key_index(bottom_left), co, bottom_left_kern); } lua_pop(L, 1); } /* end of |has_math| */ - nk = count_hash_items(L, luaS_index(kerns)); + nk = count_hash_items(L, lua_key_index(kerns)); if (nk > 0) { ckerns = xcalloc((unsigned) (nk + 1), sizeof(kerninfo)); - lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(kerns)); + lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(kerns)); lua_rawget(L, -2); if (lua_istable(L, -1)) { /* there are kerns */ ctr = 0; @@ -1383,7 +1246,7 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, k = non_boundarychar; } else if (lua_isstring(L, -2)) { s = lua_tostring(L, -2); - if (luaS_ptr_eq(s, right_boundary)) { + if (lua_key_eq(s, right_boundary)) { k = right_boundarychar; if (!has_right_boundary(f)) set_right_boundary(f, @@ -1396,7 +1259,7 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, set_kern_item(ckerns[ctr], k, j); ctr++; } else { - pdftex_warn + luatex_warn ("lua-loaded font %s char [U+%X] has an invalid kern field!", font_name(f), (int) i); } @@ -1407,7 +1270,7 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, set_kern_item(ckerns[ctr], end_kern, 0); set_charinfo_kerns(co, ckerns); } else { - pdftex_warn + luatex_warn ("lua-loaded font %s char [U+%X] has an invalid kerns field!", font_name(f), (int) i); } @@ -1416,7 +1279,7 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, } /* packet commands */ - lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_commands_index); + lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(commands)); lua_rawget(L, -2); if (lua_istable(L, -1)) { lua_pushnil(L); /* first key */ @@ -1428,11 +1291,11 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, lua_pop(L, 1); /* ligatures */ - nl = count_hash_items(L, luaS_index(ligatures)); + nl = count_hash_items(L, lua_key_index(ligatures)); if (nl > 0) { cligs = xcalloc((unsigned) (nl + 1), sizeof(liginfo)); - lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(ligatures)); + lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(ligatures)); lua_rawget(L, -2); if (lua_istable(L, -1)) { /* do ligs */ ctr = 0; @@ -1446,7 +1309,7 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, } } else if (lua_isstring(L, -2)) { s = lua_tostring(L, -2); - if (luaS_ptr_eq(s, right_boundary)) { + if (lua_key_eq(s, right_boundary)) { k = right_boundarychar; if (!has_right_boundary(f)) set_right_boundary(f, @@ -1456,15 +1319,15 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, } r = -1; if (lua_istable(L, -1)) { - r = n_numeric_field(L, luaS_char_index, -1); /* ligature */ + r = lua_numeric_field_by_index(L, lua_key_index(char), -1); /* ligature */ } if (r != -1 && k != non_boundarychar) { - t = enum_field(L, "type", 0, ligature_type_strings); - set_ligature_item(cligs[ctr], (char) ((t * 2) + 1), k, + t = n_enum_field(L, lua_key_index(type), 0, ligature_type_strings); + set_ligature_item(cligs[ctr], (char) ((t * 2) + 1), k, r); ctr++; } else { - pdftex_warn + luatex_warn ("lua-loaded font %s char [U+%X] has an invalid ligature field!", font_name(f), (int) i); } @@ -1475,7 +1338,7 @@ font_char_from_lua(lua_State * L, internal_font_number f, int i, set_ligature_item(cligs[ctr], 0, end_ligature, 0); set_charinfo_ligatures(co, cligs); } else { - pdftex_warn + luatex_warn ("lua-loaded font %s char [U+%X] has an invalid ligatures field!", font_name(f), (int) i); } @@ -1499,89 +1362,91 @@ int font_from_lua(lua_State * L, int f) char *s; const char *ss; int *l_fonts = NULL; - int save_ref = 1; /* unneeded, really */ + int save_ref ; boolean no_math = false; /* 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; /* we start with ss = "yes" */ + ss = NULL; + ss = n_string_field(L, lua_key_index(cache)); + if (lua_key_eq(ss, no)) save_ref = -1; - else if (strcmp(s, "renew") == 0) + else if (lua_key_eq(ss, renew)) save_ref = 0; - free(s); + /* n_string_field leaves a value on stack*/ + lua_pop(L,1); /* the table is at stack index -1 */ - - if (luaS_width_index == 0) + /*if (luaS_width_index == 0) init_font_string_pointers(L); - - s = string_field(L, "area", ""); + */ + + s = n_string_field_copy(L,lua_key_index(area), ""); set_font_area(f, s); - s = string_field(L, "filename", NULL); + s = n_string_field_copy(L, lua_key_index(filename), NULL); set_font_filename(f, s); - s = string_field(L, "encodingname", NULL); + s = n_string_field_copy(L, lua_key_index(encodingname), NULL); set_font_encodingname(f, s); - s = string_field(L, "name", NULL); + s = n_string_field_copy(L, lua_key_index(name), NULL); set_font_name(f, s); - s = string_field(L, "fullname", font_name(f)); + s = n_string_field_copy(L, lua_key_index(fullname), font_name(f)); set_font_fullname(f, s); if (s == NULL) { - pdftex_fail("lua-loaded font [%d] has no name!", f); + luatex_fail("lua-loaded font [%d] has no name!", f); return false; } - s = string_field(L, "psname", NULL); + s = n_string_field_copy(L, lua_key_index(psname), NULL); set_font_psname(f, s); - i = numeric_field(L, "units_per_em", 0); + i = lua_numeric_field_by_index(L,lua_key_index(units_per_em), 0); set_font_units_per_em(f, i); - i = numeric_field(L, "designsize", 655360); + i = lua_numeric_field_by_index(L,lua_key_index(designsize), 655360); set_font_dsize(f, i); - i = numeric_field(L, "size", font_dsize(f)); + i = lua_numeric_field_by_index(L,lua_key_index(size), font_dsize(f)); set_font_size(f, i); - i = numeric_field(L, "checksum", 0); + i = lua_numeric_field_by_index(L,lua_key_index(checksum), 0); set_font_checksum(f, (unsigned) i); - i = numeric_field(L, "direction", 0); + i = lua_numeric_field_by_index(L,lua_key_index(direction), 0); set_font_natural_dir(f, i); - i = numeric_field(L, "encodingbytes", 0); + i = lua_numeric_field_by_index(L,lua_key_index(encodingbytes), 0); set_font_encodingbytes(f, (char) i); - i = numeric_field(L, "tounicode", 0); + i = lua_numeric_field_by_index(L,lua_key_index(tounicode), 0); set_font_tounicode(f, (char) i); - i = numeric_field(L, "extend", 1000); + i = lua_numeric_field_by_index(L,lua_key_index(extend), 1000); if (i < FONT_EXTEND_MIN) i = FONT_EXTEND_MIN; if (i > FONT_EXTEND_MAX) i = FONT_EXTEND_MAX; set_font_extend(f, i); - i = numeric_field(L, "slant", 0); + i = lua_numeric_field_by_index(L,lua_key_index(slant), 0); if (i < FONT_SLANT_MIN) i = FONT_SLANT_MIN; if (i > FONT_SLANT_MAX) i = FONT_SLANT_MAX; set_font_slant(f, i); - i = numeric_field(L, "hyphenchar", int_par(default_hyphen_char_code)); + i = lua_numeric_field_by_index(L,lua_key_index(hyphenchar), int_par(default_hyphen_char_code)); set_hyphen_char(f, i); - i = numeric_field(L, "skewchar", int_par(default_skew_char_code)); + i = lua_numeric_field_by_index(L,lua_key_index(skewchar), int_par(default_skew_char_code)); set_skew_char(f, i); - i = boolean_field(L, "used", 0); + i = n_boolean_field(L, lua_key_index(used), 0); set_font_used(f, (char) i); - s = string_field(L, "attributes", NULL); + s = n_string_field_copy(L, lua_key_index(attributes), NULL); if (s != NULL && strlen(s) > 0) { i = maketexstring(s); set_pdf_font_attr(f, i); } - i = enum_field(L, "type", unknown_font_type, font_type_strings); + i = n_enum_field(L, lua_key_index(type), unknown_font_type, font_type_strings); set_font_type(f, i); - i = enum_field(L, "format", unknown_format, font_format_strings); + i = n_enum_field(L, lua_key_index(format), unknown_format, font_format_strings); set_font_format(f, i); - i = enum_field(L, "embedding", unknown_embedding, font_embedding_strings); + i = n_enum_field(L, lua_key_index(embedding), unknown_embedding, font_embedding_strings); set_font_embedding(f, i); if (font_encodingbytes(f) == 0 && (font_format(f) == opentype_format @@ -1590,16 +1455,16 @@ int font_from_lua(lua_State * L, int f) } /* now fetch the base fonts, if needed */ - n = count_hash_items(L, luaS_index(fonts)); + n = count_hash_items(L, lua_key_index(fonts)); if (n > 0) { l_fonts = xmalloc((unsigned) ((unsigned) (n + 2) * sizeof(int))); memset(l_fonts, 0, (size_t) ((unsigned) (n + 2) * sizeof(int))); - lua_rawgeti(L, LUA_REGISTRYINDEX, luaS_index(fonts)); + lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(fonts)); lua_rawget(L, -2); for (i = 1; i <= n; i++) { lua_rawgeti(L, -1, i); if (lua_istable(L, -1)) { - lua_getfield(L, -1, "id"); + lua_key_rawgeti(id); if (lua_isnumber(L, -1)) { l_fonts[i]=(int)lua_tonumber(L, -1); lua_pop(L, 2); /* pop id and entry */ @@ -1609,17 +1474,18 @@ int font_from_lua(lua_State * L, int f) }; ss = NULL; if (lua_istable(L, -1)) { - lua_getfield(L, -1, "name"); - if (lua_isstring(L, -1)) { - ss = lua_tostring(L, -1); - } - lua_pop(L, 1); /* pop name */ + /* lua_getfield(L, -1, "name"); */ + /* if (lua_isstring(L, -1)) { */ + /* ss = lua_tostring(L, -1); */ + /* } */ + /* lua_pop(L, 1); /\* pop name *\/ */ + ss = n_string_field(L, lua_key_index(name)); } if (ss != NULL) { - lua_getfield(L, -1, "size"); - t = (lua_isnumber(L, -1) ? lua_roundnumber(L, -1) : -1000); - lua_pop(L, 1); - + /* lua_getfield(L, -1, "size"); */ + /* t = (lua_isnumber(L, -1) ? lua_roundnumber(L, -1) : -1000); */ + /* lua_pop(L, 1); */ + t = lua_numeric_field_by_index(L, lua_key_index(size), -1000); /* TODO: the stack is messed up, otherwise this * explicit resizing would not be needed */ @@ -1630,14 +1496,14 @@ int font_from_lua(lua_State * L, int f) l_fonts[i] = find_font_id(ss, t); lua_settop(L, s_top); } else { - pdftex_fail("Invalid local font in font %s!\n", font_name(f)); + luatex_fail("Invalid local font in font %s!\n", font_name(f)); } lua_pop(L, 1); /* pop list entry */ } lua_pop(L, 1); /* pop list entry */ } else { if (font_type(f) == virtual_font_type) { - pdftex_fail("Invalid local fonts in font %s!\n", font_name(f)); + luatex_fail("Invalid local fonts in font %s!\n", font_name(f)); } else { l_fonts = xmalloc(3 * sizeof(int)); l_fonts[0] = 0; @@ -1647,7 +1513,7 @@ int font_from_lua(lua_State * L, int f) } /* parameters */ - no_math = boolean_field(L, "nomath", 0); + no_math = n_boolean_field(L, lua_key_index(nomath), 0); read_lua_parameters(L, f); if (!no_math) { read_lua_math_parameters(L, f); @@ -1655,8 +1521,9 @@ int font_from_lua(lua_State * L, int f) read_lua_cidinfo(L, f); /* characters */ - - lua_getfield(L, -1, "characters"); + //lua_rawgeti(L, LUA_REGISTRYINDEX, lua_key_index(characters));lua_rawget(L, -2); + lua_key_rawgeti(characters); + /*lua_getfield(L, -1, "characters");*/ if (lua_istable(L, -1)) { /* find the array size values */ int num = 0; /* number of charinfo's to add */ @@ -1696,10 +1563,10 @@ int font_from_lua(lua_State * L, int f) } } else if (lua_isstring(L, -2)) { const char *ss1 = lua_tostring(L, -2); - if (luaS_ptr_eq(ss1, left_boundary)) { + if (lua_key_eq(ss1, left_boundary)) { font_char_from_lua(L, f, left_boundarychar, l_fonts, !no_math); - } else if (luaS_ptr_eq(ss1, right_boundary)) { + } else if (lua_key_eq(ss1, right_boundary)) { font_char_from_lua(L, f, right_boundarychar, l_fonts, !no_math); } @@ -1711,15 +1578,15 @@ int font_from_lua(lua_State * L, int f) /* handle font expansion last: the |copy_font| routine is called eventually, and that needs to know |bc| and |ec|. */ if (font_type(f) != virtual_font_type) { - int fstep = numeric_field(L, "step", 0); + int fstep = lua_numeric_field_by_index(L, lua_key_index(step), 0); if (fstep < 0) fstep = 0; if (fstep > 100) fstep = 100; if (fstep != 0) { - int fshrink = numeric_field(L, "shrink", 0); - int fstretch = numeric_field(L, "stretch", 0); - int fexpand = boolean_field(L, "auto_expand", 0); + int fshrink = lua_numeric_field_by_index(L, lua_key_index(shrink), 0); + int fstretch =lua_numeric_field_by_index(L, lua_key_index(stretch), 0); + int fexpand = n_boolean_field(L, lua_key_index(auto_expand), 0); if (fshrink < 0) fshrink = 0; if (fshrink > 500) @@ -1739,7 +1606,7 @@ int font_from_lua(lua_State * L, int f) } } else { /* jikes, no characters */ - pdftex_warn("lua-loaded font [%d] (%s) has no characters!", f, + luatex_warn("lua-loaded font [%d] (%s) has no characters!", f, font_name(f)); } @@ -1751,7 +1618,7 @@ int font_from_lua(lua_State * L, int f) set_font_cache_id(f, save_ref); } } else { /* jikes, no characters */ - pdftex_warn("lua-loaded font [%d] (%s) has no character table!", f, + luatex_warn("lua-loaded font [%d] (%s) has no character table!", f, font_name(f)); } diff --git a/Build/source/texk/web2c/luatexdir/font/luatexfont.h b/Build/source/texk/web2c/luatexdir/font/luatexfont.h index 0d78199862b..bb4901d5107 100644 --- a/Build/source/texk/web2c/luatexdir/font/luatexfont.h +++ b/Build/source/texk/web2c/luatexdir/font/luatexfont.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: luatexfont.h 4679 2013-12-19 15:47:53Z luigi $ */ +/* $Id: luatexfont.h 4781 2014-02-10 11:05:24Z taco $ */ #ifndef LUATEXFONT_H # define LUATEXFONT_H diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.w b/Build/source/texk/web2c/luatexdir/font/mapfile.w index c6d826da9b5..aa076a0a587 100644 --- a/Build/source/texk/web2c/luatexdir/font/mapfile.w +++ b/Build/source/texk/web2c/luatexdir/font/mapfile.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = - "$Id: mapfile.w 4718 2014-01-02 15:35:31Z taco $" + "$Id: mapfile.w 4847 2014-03-05 18:13:17Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/mapfile.w $"; #include "ptexlib.h" @@ -166,7 +166,7 @@ int avl_do_entry(fm_entry * fm, int mode) if (p != NULL) { switch (mode) { case FM_DUPIGNORE: - pdftex_warn + luatex_warn ("fontmap entry for `%s' already exists, duplicates ignored", fm->tfm_name); delete_new = 1; @@ -174,7 +174,7 @@ int avl_do_entry(fm_entry * fm, int mode) case FM_REPLACE: case FM_DELETE: if (is_inuse(p)) { - pdftex_warn + luatex_warn ("fontmap entry for `%s' has been used, replace/delete not allowed", fm->tfm_name); delete_new = 1; @@ -222,7 +222,7 @@ static int check_fm_entry(fm_entry * fm, boolean warn) if (is_fontfile(fm) && !is_included(fm)) { if (warn) - pdftex_warn + luatex_warn ("ambiguous entry for `%s': font file present but not included, " "will be treated as font file not present", fm->tfm_name); xfree(fm->ff_name); @@ -232,7 +232,7 @@ static int check_fm_entry(fm_entry * fm, boolean warn) /* if both ps_name and font file are missing, drop this entry */ if (fm->ps_name == NULL && !is_fontfile(fm)) { if (warn) - pdftex_warn + luatex_warn ("invalid entry for `%s': both ps_name and font file missing", fm->tfm_name); a += 1; @@ -241,7 +241,7 @@ static int check_fm_entry(fm_entry * fm, boolean warn) /* TrueType fonts cannot be reencoded without subsetting */ if (is_truetype(fm) && is_reencoded(fm) && !is_subsetted(fm)) { if (warn) - pdftex_warn + luatex_warn ("invalid entry for `%s': only subsetted TrueType font can be reencoded", fm->tfm_name); a += 2; @@ -250,14 +250,14 @@ static int check_fm_entry(fm_entry * fm, boolean warn) /* the value of SlantFont and ExtendFont must be reasonable */ if (fm->slant < FONT_SLANT_MIN || fm->slant > FONT_SLANT_MAX) { if (warn) - pdftex_warn + luatex_warn ("invalid entry for `%s': too big value of SlantFont (%g)", fm->tfm_name, fm->slant / 1000.0); a += 8; } if (fm->extend < FONT_EXTEND_MIN || fm->extend > FONT_EXTEND_MAX) { if (warn) - pdftex_warn + luatex_warn ("invalid entry for `%s': too big value of ExtendFont (%g)", fm->tfm_name, fm->extend / 1000.0); a += 16; @@ -267,7 +267,7 @@ static int check_fm_entry(fm_entry * fm, boolean warn) if (fm->pid != -1 && !(is_truetype(fm) && is_subsetted(fm) && !is_reencoded(fm))) { if (warn) - pdftex_warn + luatex_warn ("invalid entry for `%s': PidEid can be used only with subsetted non-reencoded TrueType fonts", fm->tfm_name); a += 32; @@ -406,7 +406,7 @@ static void fm_scan_line(void) for (r = s; *r != ' ' && *r != '"' && *r != '\0'; r++); /* jump over name */ c = *r; /* remember char for temporary end of string */ *r = '\0'; - pdftex_warn + luatex_warn ("invalid entry for `%s': unknown name `%s' ignored", fm->tfm_name, s); *r = (char) c; @@ -418,7 +418,7 @@ static void fm_scan_line(void) if (*r == '"') /* closing quote */ r++; else { - pdftex_warn + luatex_warn ("invalid entry for `%s': closing quote missing", fm->tfm_name); goto bad_line; @@ -528,14 +528,14 @@ static void fm_read_info(void) fm_file = NULL; } } else { - pdftex_warn("cannot open font map file (%s)", cur_file_name); + luatex_warn("cannot open font map file (%s)", cur_file_name); } } else { - pdftex_warn("cannot open font map file (%s)", cur_file_name); + luatex_warn("cannot open font map file (%s)", cur_file_name); } } else { if (!fm_open(cur_file_name)) { - pdftex_warn("cannot open font map file (%s)", cur_file_name); + luatex_warn("cannot open font map file (%s)", cur_file_name); } else { fm_read_file(); tex_printf("{%s", cur_file_name); @@ -552,7 +552,7 @@ static void fm_read_info(void) } break; case MAPLINE: - cur_file_name = NULL; /* makes pdftex_warn() shorter */ + cur_file_name = NULL; /* makes luatex_warn() shorter */ fm_scan_line(); break; default: diff --git a/Build/source/texk/web2c/luatexdir/font/pkin.w b/Build/source/texk/web2c/luatexdir/font/pkin.w index 9be0e3c1b09..d96e69537c7 100644 --- a/Build/source/texk/web2c/luatexdir/font/pkin.w +++ b/Build/source/texk/web2c/luatexdir/font/pkin.w @@ -48,8 +48,8 @@ Modified for use with pdftex by Han The Thanh <thanh@@fi.muni.cz>. @c static const char _svn_version[] = - "$Id: pkin.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/pkin.w $"; + "$Id: pkin.w 4847 2014-03-05 18:13:17Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/pkin.w $"; #include "ptexlib.h" @@ -65,7 +65,7 @@ static shalfword pkbyte(void) register shalfword i; i = t3_getchar(); if (t3_eof()) - pdftex_fail("unexpected eof in pk file"); + luatex_fail("unexpected eof in pk file"); return (i); } @@ -202,7 +202,7 @@ static halfword rest(void) return (i); } } else { - pdftex_fail("shouldn't happen"); + luatex_fail("shouldn't happen"); return 0; /*NOTREACHED*/} } @@ -321,7 +321,7 @@ static void unpack(chardesc * cd) turnon = !turnon; } if ((rowsleft != 0) || ((int) hbit != cd->cwidth)) - pdftex_fail("error while unpacking; more bits than required"); + luatex_fail("error while unpacking; more bits than required"); } } @@ -343,9 +343,9 @@ int readchar(boolean check_preamble, chardesc * cd) */ if (check_preamble) { if (pkbyte() != 247) - pdftex_fail("bad pk file, expected pre"); + luatex_fail("bad pk file, expected pre"); if (pkbyte() != 89) - pdftex_fail("bad version of pk file"); + luatex_fail("bad version of pk file"); for (i = pkbyte(); i > 0; i--) /* creator of pkfile */ (void) pkbyte(); (void) pkquad(); /* design size */ @@ -401,7 +401,7 @@ int readchar(boolean check_preamble, chardesc * cd) cd->yoff = pkquad(); } if (length <= 0) - pdftex_fail("packet length (%i) too small", (int) length); + luatex_fail("packet length (%i) too small", (int) length); unpack(cd); return 1; } else { @@ -426,7 +426,7 @@ int readchar(boolean check_preamble, chardesc * cd) case 246: break; default: - pdftex_fail("unexpected command (%i)", (int) flagbyte); + luatex_fail("unexpected command (%i)", (int) flagbyte); } } } diff --git a/Build/source/texk/web2c/luatexdir/font/sfnt.h b/Build/source/texk/web2c/luatexdir/font/sfnt.h index dda13643ff6..74f5701ec0f 100644 --- a/Build/source/texk/web2c/luatexdir/font/sfnt.h +++ b/Build/source/texk/web2c/luatexdir/font/sfnt.h @@ -19,7 +19,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: sfnt.h 3765 2010-07-29 07:10:21Z taco $ */ +/* $Id: sfnt.h 4847 2014-03-05 18:13:17Z luigi $ */ #ifndef _SFNT_H_ # define _SFNT_H_ @@ -183,7 +183,7 @@ typedef struct { # define RELEASE(a) free(a) # define NEW(a,b) xmalloc((unsigned)((unsigned)(a)*sizeof(b))) # define RENEW(a,b,c) xrealloc(a, (unsigned)((unsigned)(b)*sizeof(c))) -# define TT_ERROR pdftex_fail +# define TT_ERROR luatex_fail # define WARN printf diff --git a/Build/source/texk/web2c/luatexdir/font/subfont.w b/Build/source/texk/web2c/luatexdir/font/subfont.w index 5b436393d98..06678c1e195 100644 --- a/Build/source/texk/web2c/luatexdir/font/subfont.w +++ b/Build/source/texk/web2c/luatexdir/font/subfont.w @@ -20,8 +20,8 @@ @ @c static const char _svn_version[] = - "$Id: subfont.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/subfont.w $"; + "$Id: subfont.w 4847 2014-03-05 18:13:17Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/subfont.w $"; #include "ptexlib.h" #include <string.h> @@ -105,7 +105,7 @@ static void sfd_getline(boolean expect_eof) if (expect_eof) return; else - pdftex_fail("unexpected end of file"); + luatex_fail("unexpected end of file"); } p = sfd_line; do { @@ -149,13 +149,13 @@ static sfd_entry *read_sfd(char *sfd_name) if (!(run_callback(callback_id, "S->bSd", cur_file_name, &file_opened, &sfd_buffer, &sfd_size) && file_opened && sfd_size > 0)) { - pdftex_warn("cannot open SFD file for reading (%s)", cur_file_name); + luatex_warn("cannot open SFD file for reading (%s)", cur_file_name); cur_file_name = NULL; return NULL; } } else { if (!sfd_open(cur_file_name)) { - pdftex_warn("cannot open SFD file for reading (%s)", cur_file_name); + luatex_warn("cannot open SFD file for reading (%s)", cur_file_name); cur_file_name = NULL; return NULL; } @@ -187,16 +187,16 @@ static sfd_entry *read_sfd(char *sfd_name) } else if (*p == 0) /* end of subfont */ break; if (sscanf(p, " %li %n", &i, &n) == 0) - pdftex_fail("invalid token:\n%s", p); + luatex_fail("invalid token:\n%s", p); p += n; if (*p == ':') { /* offset */ k = i; p++; } else if (*p == '_') { /* range */ if (sscanf(p + 1, " %li %n", &j, &n) == 0) - pdftex_fail("invalid token:\n%s", p); + luatex_fail("invalid token:\n%s", p); if (i > j || k + (j - i) > 255) - pdftex_fail("invalid range:\n%s", p); + luatex_fail("invalid range:\n%s", p); while (i <= j) sf->charcodes[k++] = i++; p += n + 1; diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.w b/Build/source/texk/web2c/luatexdir/font/texfont.w index 86bdda167d6..6d2358349d3 100644 --- a/Build/source/texk/web2c/luatexdir/font/texfont.w +++ b/Build/source/texk/web2c/luatexdir/font/texfont.w @@ -32,7 +32,7 @@ problematic |if 0 != null|. @c static const char _svn_version[] = - "$Id: texfont.w 4685 2013-12-20 13:39:30Z luigi $" + "$Id: texfont.w 4847 2014-03-05 18:13:17Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/texfont.w $"; #include "ptexlib.h" @@ -196,7 +196,7 @@ static void set_charinfo(internal_font_number f, int c, charinfo * ci) if (glyph) { font_tables[f]->charinfo[glyph] = *ci; } else { - pdftex_fail("font: %s", "character insertion failed"); + luatex_fail("font: %s", "character insertion failed"); } } else if (c == left_boundarychar) { set_left_boundary(f, ci); diff --git a/Build/source/texk/web2c/luatexdir/font/tounicode.w b/Build/source/texk/web2c/luatexdir/font/tounicode.w index e303e470fa4..b33bef027a0 100644 --- a/Build/source/texk/web2c/luatexdir/font/tounicode.w +++ b/Build/source/texk/web2c/luatexdir/font/tounicode.w @@ -20,8 +20,8 @@ @ @c static const char _svn_version[] = - "$Id: tounicode.w 4643 2013-09-16 20:33:56Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/tounicode.w $"; + "$Id: tounicode.w 4847 2014-03-05 18:13:17Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/tounicode.w $"; #include "ptexlib.h" @@ -99,7 +99,7 @@ void def_tounicode(str_number glyph, str_number unistr) } if (l == 0 || valid_unistr == 0 || strlen(buf) == 0 || strcmp(buf, notdef) == 0) { - pdftex_warn("ToUnicode: invalid parameter(s): `%s' => `%s'", buf, p); + luatex_warn("ToUnicode: invalid parameter(s): `%s' => `%s'", buf, p); return; } if (glyph_unicode_tree == NULL) { @@ -311,7 +311,7 @@ int write_tounicode(PDF pdf, char **glyph_names, char *name) assert(strlen(name) + strlen(builtin_suffix) < SMALL_BUF_SIZE); if (glyph_unicode_tree == NULL) { #ifdef DEBUG - pdftex_warn("no GlyphToUnicode entry has been inserted yet!"); + luatex_warn("no GlyphToUnicode entry has been inserted yet!"); #endif pdf->gen_tounicode = 0; return 0; diff --git a/Build/source/texk/web2c/luatexdir/font/vfovf.w b/Build/source/texk/web2c/luatexdir/font/vfovf.w index 1e21b55f630..1ce4165a5df 100644 --- a/Build/source/texk/web2c/luatexdir/font/vfovf.w +++ b/Build/source/texk/web2c/luatexdir/font/vfovf.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = - "$Id: vfovf.w 4679 2013-12-19 15:47:53Z luigi $" + "$Id: vfovf.w 4847 2014-03-05 18:13:17Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/vfovf.w $"; #include "ptexlib.h" @@ -133,7 +133,7 @@ typedef struct vf_stack_record { { \ eight_bits vf_tmp_b; \ if (vf_cur >= vf_size) { \ - pdftex_fail("unexpected eof on virtual font"); \ + luatex_fail("unexpected eof on virtual font"); \ } \ vf_tmp_b = vf_buffer[vf_cur++]; \ a = vf_tmp_b; \ diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.w b/Build/source/texk/web2c/luatexdir/font/writecff.w index 5ec397b4a23..ed0ec53ce1e 100644 --- a/Build/source/texk/web2c/luatexdir/font/writecff.w +++ b/Build/source/texk/web2c/luatexdir/font/writecff.w @@ -19,7 +19,7 @@ @ @c static const char _svn_version[] = - "$Id: writecff.w 4690 2013-12-21 22:25:27Z luigi $" + "$Id: writecff.w 4847 2014-03-05 18:13:17Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writecff.w $"; #include "ptexlib.h" @@ -51,9 +51,9 @@ static unsigned long get_unsigned(cff_font * cff, int n) } @ @c -#define CFF_ERROR pdftex_fail +#define CFF_ERROR luatex_fail #undef WARN -#define WARN pdftex_warn +#define WARN luatex_warn const char *const cff_stdstr[CFF_STDSTR_MAX] = { ".notdef", "space", "exclam", "quotedbl", "numbersign", @@ -863,7 +863,7 @@ cff_dict *cff_dict_unpack(card8 * data, card8 * endptr) } if (status != CFF_PARSE_OK) { - pdftex_fail("Parsing CFF DICT failed. (error=%d)", status); + luatex_fail("Parsing CFF DICT failed. (error=%d)", status); } else if (stack_top != 0) { WARN("Garbage in CFF DICT data."); stack_top = 0; @@ -899,13 +899,13 @@ double cff_dict_get(cff_dict * dict, const char *key, int idx) if ((dict->entries)[i].count > idx) value = (dict->entries)[i].values[idx]; else - pdftex_fail("Invalid index number."); + luatex_fail("Invalid index number."); break; } } if (i == dict->count) - pdftex_fail("DICT entry \"%s\" not found.", key); + luatex_fail("DICT entry \"%s\" not found.", key); return value; } @@ -1122,7 +1122,7 @@ cff_font *read_cff(unsigned char *buf, long buflength, int n) return NULL; } if (cff->header_major > 1) { - pdftex_warn("CFF major version %u not supported.", cff->header_major); + luatex_warn("CFF major version %u not supported.", cff->header_major); cff_close(cff); return NULL; } @@ -1131,7 +1131,7 @@ cff_font *read_cff(unsigned char *buf, long buflength, int n) /* Name INDEX */ idx = cff_get_index(cff); if (n > idx->count - 1) { - pdftex_warn("Invalid CFF fontset index number."); + luatex_warn("Invalid CFF fontset index number."); cff_close(cff); return NULL; } @@ -1540,7 +1540,7 @@ void cff_dict_set(cff_dict * dict, const char *key, int idx, double value) } if (i == dict->count) - pdftex_fail("DICT entry \"%s\" not found.", key); + luatex_fail("DICT entry \"%s\" not found.", key); } @@ -3014,7 +3014,7 @@ static void write_fontfile(PDF pdf, cff_font * cffont, char *fullname) if ((avl_find(fd->gl_tree,glyph) != NULL)) { \ size = (long)(cs_idx->offset[code+1] - cs_idx->offset[code]); \ if (size > CS_STR_LEN_MAX) { \ - pdftex_fail("Charstring too long: gid=%u, %ld bytes", code, size); \ + luatex_fail("Charstring too long: gid=%u, %ld bytes", code, size); \ } \ if (charstring_len + CS_STR_LEN_MAX >= max_len) { \ max_len = (long)(charstring_len + 2 * CS_STR_LEN_MAX); \ @@ -3457,7 +3457,7 @@ void write_cid_cff(PDF pdf, cff_font * cffont, fd_entry * fd) (CIDToGIDMap[2 * cid + 1])); size = (long) (cs_idx->offset[gid_org + 1] - cs_idx->offset[gid_org]); if (size > CS_STR_LEN_MAX) { - pdftex_fail("Charstring too long: gid=%u, %ld bytes", cid, size); + luatex_fail("Charstring too long: gid=%u, %ld bytes", cid, size); } if (charstring_len + CS_STR_LEN_MAX >= max_len) { max_len = charstring_len + 2 * CS_STR_LEN_MAX; diff --git a/Build/source/texk/web2c/luatexdir/font/writefont.w b/Build/source/texk/web2c/luatexdir/font/writefont.w index 6e4808e6b76..ff986bf86fe 100644 --- a/Build/source/texk/web2c/luatexdir/font/writefont.w +++ b/Build/source/texk/web2c/luatexdir/font/writefont.w @@ -20,8 +20,8 @@ @ @c static const char _svn_version[] = - "$Id: writefont.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/writefont.w $"; + "$Id: writefont.w 4847 2014-03-05 18:13:17Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writefont.w $"; #include "ptexlib.h" #include "lua/luatex-api.h" @@ -525,7 +525,7 @@ static void write_fontdescriptor(PDF pdf, fd_entry * fd) fd_flags = is_std_t1font(fd->fm) ? std_flags[check_std_t1font(fd->fm->ps_name)] : FD_FLAGS_DEFAULT_NON_EMBED; - pdftex_warn + luatex_warn ("No flags specified for non-embedded font `%s' (%s) (I'm using %i): " "fix your map entry.", fd->fm->ps_name != NULL ? fd->fm->ps_name : "No name given", @@ -716,7 +716,7 @@ static void create_fontdictionary(PDF pdf, internal_font_number f) create_fontdescriptor(fo, f); write_fontdescriptor(pdf, fo->fd); if (!is_std_t1font(fo->fm)) - pdftex_warn("font `%s' is not a standard font; " + luatex_warn("font `%s' is not a standard font; " "I suppose it is available to your PDF viewer then", fo->fm->ps_name); } @@ -780,7 +780,7 @@ void do_pdf_font(PDF pdf, internal_font_number f) fm->ff_name = s; del_file = 1; } else { - pdftex_fail + luatex_fail ("writefont.c: The file (%s) does not contain font `%s'", fm->ff_name, fm->ps_name); } @@ -808,7 +808,7 @@ void do_pdf_font(PDF pdf, internal_font_number f) set_type1(fm); break; default: - pdftex_fail + luatex_fail ("writefont.c: The file format (%s) for font `%s' is incompatible with wide characters\n", font_format_name(f), font_name(f)); } diff --git a/Build/source/texk/web2c/luatexdir/font/writet1.w b/Build/source/texk/web2c/luatexdir/font/writet1.w index 37af7723320..567d3768936 100644 --- a/Build/source/texk/web2c/luatexdir/font/writet1.w +++ b/Build/source/texk/web2c/luatexdir/font/writet1.w @@ -20,8 +20,8 @@ @ @c static const char _svn_version[] = - "$Id: writet1.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/writet1.w $"; + "$Id: writet1.w 4847 2014-03-05 18:13:17Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writet1.w $"; #include "ptexlib.h" #include <string.h> @@ -257,7 +257,7 @@ static void enc_getline(void) char c; restart: if (enc_eof()) - pdftex_fail("unexpected end of file"); + luatex_fail("unexpected end of file"); p = enc_line; do { c = (char) enc_getchar(); @@ -283,7 +283,7 @@ char **load_enc_file(char *enc_name) cur_file_name = luatex_find_file(enc_name, find_enc_file_callback); if (cur_file_name == NULL) { - pdftex_fail("cannot find encoding file '%s' for reading", enc_name); + luatex_fail("cannot find encoding file '%s' for reading", enc_name); } callback_id = callback_defined(read_enc_file_callback); enc_curbyte = 0; @@ -292,12 +292,12 @@ char **load_enc_file(char *enc_name) if (run_callback(callback_id, "S->bSd", cur_file_name, &file_opened, &enc_buffer, &enc_size)) { if ((!file_opened) || enc_size == 0) { - pdftex_fail("cannot open encoding file '%s' for reading", cur_file_name); + luatex_fail("cannot open encoding file '%s' for reading", cur_file_name); } } } else { if (!enc_open(cur_file_name)) { - pdftex_fail("cannot open encoding file '%s' for reading", cur_file_name); + luatex_fail("cannot open encoding file '%s' for reading", cur_file_name); } enc_read_file(); enc_close(); @@ -311,7 +311,7 @@ char **load_enc_file(char *enc_name) enc_getline(); if (*enc_line != '/' || (r = strchr(enc_line, '[')) == NULL) { remove_eol(r, enc_line); - pdftex_fail + luatex_fail ("invalid encoding vector (a name or `[' missing): `%s'", enc_line); } names_count = 0; @@ -324,7 +324,7 @@ char **load_enc_file(char *enc_name) *p = 0; skip(r, ' '); if (names_count >= 256) - pdftex_fail("encoding vector contains more than 256 names"); + luatex_fail("encoding vector contains more than 256 names"); if (strcmp(buf, notdef) != 0) glyph_names[names_count] = xstrdup(buf); names_count++; @@ -334,7 +334,7 @@ char **load_enc_file(char *enc_name) goto done; else { remove_eol(r, enc_line); - pdftex_fail + luatex_fail ("invalid encoding vector: a name or `] def' expected: `%s'", enc_line); } @@ -376,7 +376,7 @@ static int t1_getbyte(void) return c; if (t1_block_length == 0) { if (c != 128) - pdftex_fail("invalid marker"); + luatex_fail("invalid marker"); c = t1_getchar(); if (c == 3) { while (!t1_eof()) @@ -456,7 +456,7 @@ static float t1_scan_num(char *p, char **r) skip(p, ' '); if (sscanf(p, "%g", &f) != 1) { remove_eol(p, t1_line_array); - pdftex_fail("a number expected: `%s'", t1_line_array); + luatex_fail("a number expected: `%s'", t1_line_array); } if (r != NULL) { for (; isdigit(*p) || *p == '.' || @@ -488,7 +488,7 @@ static void t1_getline(void) static int eexec_len = 17; /* |strlen(eexec_str)| */ restart: if (t1_eof()) - pdftex_fail("unexpected end of file"); + luatex_fail("unexpected end of file"); t1_line_ptr = t1_line_array; alloc_array(t1_line, 1, T1_BUF_SIZE); t1_cslen = 0; @@ -605,7 +605,7 @@ static void t1_check_block_len(boolean decrypt) c = edecrypt((byte) c); l = (int) t1_block_length; if (!(l == 0 && (c == 10 || c == 13))) { - pdftex_fail("%i bytes more than expected were ignored", l + 1); + luatex_fail("%i bytes more than expected were ignored", l + 1); } } @@ -642,7 +642,7 @@ static void t1_stop_eexec(PDF pdf) if (last_hexbyte == 0) t1_puts(pdf, "00"); else - pdftex_fail("unexpected data after eexec"); + luatex_fail("unexpected data after eexec"); } } t1_cs = false; @@ -680,7 +680,7 @@ static void t1_scan_keys(PDF pdf) if (t1_prefix("/FontType")) { p = t1_line_array + strlen("FontType") + 1; if ((i = (int) t1_scan_num(p, 0)) != 1) - pdftex_fail("Type%d fonts unsupported by pdfTeX", i); + luatex_fail("Type%d fonts unsupported by pdfTeX", i); return; } for (key = (const key_entry *) font_key; key - font_key < FONT_KEYS_NUM; @@ -696,7 +696,7 @@ static void t1_scan_keys(PDF pdf) if ((k = (int) (key - font_key)) == FONTNAME_CODE) { if (*p != '/') { remove_eol(p, t1_line_array); - pdftex_fail("a name expected: `%s'", t1_line_array); + luatex_fail("a name expected: `%s'", t1_line_array); } r = ++p; /* skip the slash */ for (q = t1_buf_array; *p != ' ' && *p != 10; *q++ = *p++); @@ -738,7 +738,7 @@ static void t1_scan_param(PDF pdf) if (t1_prefix(lenIV)) { t1_lenIV = (short) t1_scan_num(t1_line_array + strlen(lenIV), 0); if (t1_lenIV < 0) - pdftex_fail("negative value of lenIV is not supported"); + luatex_fail("negative value of lenIV is not supported"); return; } t1_scan_keys(pdf); @@ -776,7 +776,7 @@ static char **t1_builtin_enc(void) } return glyph_names; } else - pdftex_fail + luatex_fail ("cannot subset font (unknown predefined encoding `%s')", t1_buf_array); } @@ -808,7 +808,7 @@ static char **t1_builtin_enc(void) *p = 0; skip(r, ' '); if (counter > 255) - pdftex_fail("encoding vector contains more than 256 names"); + luatex_fail("encoding vector contains more than 256 names"); if (strcmp(t1_buf_array, notdef) != 0) glyph_names[counter] = xstrdup(t1_buf_array); counter++; @@ -818,7 +818,7 @@ static char **t1_builtin_enc(void) break; else { remove_eol(r, t1_line_array); - pdftex_fail + luatex_fail ("a name or `] def' or `] readonly def' expected: `%s'", t1_line_array); } @@ -906,13 +906,13 @@ static boolean t1_open_fontfile(const char *open_name_prefix) t1_size = 0; ff = check_ff_exist(fd_cur->fm->ff_name, is_truetype(fd_cur->fm)); if (ff->ff_path == NULL) { - pdftex_fail("cannot open Type 1 font file for reading (%s)", + luatex_fail("cannot open Type 1 font file for reading (%s)", fd_cur->fm->ff_name); return false; } cur_file_name = luatex_find_file(ff->ff_path, find_type1_file_callback); if (cur_file_name == NULL) { - pdftex_fail("cannot open Type 1 font file for reading (%s)", + luatex_fail("cannot open Type 1 font file for reading (%s)", ff->ff_path); return false; } @@ -921,7 +921,7 @@ static boolean t1_open_fontfile(const char *open_name_prefix) if (!run_callback(callback_id, "S->bSd", cur_file_name, &file_opened, &t1_buffer, &t1_size) && file_opened && t1_size > 0) { - pdftex_warn("cannot open Type 1 font file for reading (%s)", + luatex_warn("cannot open Type 1 font file for reading (%s)", cur_file_name); return false; } @@ -972,7 +972,7 @@ static void t1_include(PDF pdf) @c #define check_subr(subr) \ if (subr >= subr_size || subr < 0) \ - pdftex_fail("Subrs array: entry index out of range (%i)", subr); + luatex_fail("Subrs array: entry index out of range (%i)", subr); static const char **check_cs_token_pair(void) { @@ -998,7 +998,7 @@ static void cs_store(boolean is_subr) } else { ptr = cs_ptr++; if (cs_ptr - cs_tab > cs_size) - pdftex_fail + luatex_fail ("CharStrings dict: more entries than dict size (%i)", cs_size); if (strcmp(t1_buf_array + 1, notdef) == 0) /* skip the slash */ ptr->name = (char *) notdef; @@ -1040,7 +1040,7 @@ static boolean is_cc_init = false; stack_ptr -= N #define stack_error(N) { \ - pdftex_fail("CharString: invalid access (%i) to stack (%i entries)", \ + luatex_fail("CharString: invalid access (%i) to stack (%i entries)", \ (int) N, (int)(stack_ptr - cc_stack)); \ goto cs_error; \ } @@ -1110,9 +1110,9 @@ static void cs_fail(const char *cs_name, int subr, const char *fmt, ...) vsprintf(buf, fmt, args); va_end(args); if (cs_name == NULL) - pdftex_fail("Subr (%i): %s", (int) subr, buf); + luatex_fail("Subr (%i): %s", (int) subr, buf); else - pdftex_fail("CharString (/%s): %s", cs_name, buf); + luatex_fail("CharString (/%s): %s", cs_name, buf); } @ fix a return-less subr by appending |CS_RETURN| @@ -1176,7 +1176,7 @@ static void cs_mark(const char *cs_name, int subr) if (strcmp(ptr->name, cs_name) == 0) break; if (ptr == cs_ptr) { - pdftex_warn("glyph `%s' undefined", cs_name); + luatex_warn("glyph `%s' undefined", cs_name); return; } if (ptr->name == notdef) @@ -1282,7 +1282,7 @@ static void cs_mark(const char *cs_name, int subr) } } if (cs_name == NULL && last_cmd != CS_RETURN) { - pdftex_warn("last command in subr `%i' is not a RETURN; " + luatex_warn("last command in subr `%i' is not a RETURN; " "I will add it now but please consider fixing the font", (int) subr); append_cs_return(ptr); @@ -1670,7 +1670,7 @@ static void t1_subset_charstrings(PDF pdf) t1_mark_glyphs(); if (subr_tab != NULL) { if (cs_token_pair == NULL) - pdftex_fail + luatex_fail ("This Type 1 font uses mismatched subroutine begin/end token pairs."); t1_subr_flush(); } diff --git a/Build/source/texk/web2c/luatexdir/font/writet3.w b/Build/source/texk/web2c/luatexdir/font/writet3.w index 54fb3c1f4f0..c03a6d84374 100644 --- a/Build/source/texk/web2c/luatexdir/font/writet3.w +++ b/Build/source/texk/web2c/luatexdir/font/writet3.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = - "$Id: writet3.w 4718 2014-01-02 15:35:31Z taco $" + "$Id: writet3.w 4847 2014-03-05 18:13:17Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writet3.w $"; #include "ptexlib.h" @@ -50,7 +50,7 @@ int t3_curbyte = 0; #define t3_check_eof() \ if (t3_eof()) \ - pdftex_fail("unexpected end of file"); + luatex_fail("unexpected end of file"); @ @c @@ -141,7 +141,7 @@ static boolean writepk(PDF pdf, internal_font_number f) if (name == NULL || !FILESTRCASEEQ(cur_file_name, font_ret.name) || !kpse_bitmap_tolerance((float) font_ret.dpi, (float) dpi)) { - pdftex_fail("Font %s at %i not found", cur_file_name, (int) dpi); + luatex_fail("Font %s at %i not found", cur_file_name, (int) dpi); } } callback_id = callback_defined(read_pk_file_callback); @@ -150,7 +150,7 @@ static boolean writepk(PDF pdf, internal_font_number f) (run_callback (callback_id, "S->bSd", name, &file_opened, &t3_buffer, &t3_size) && file_opened && t3_size > 0)) { - pdftex_warn("Font %s at %i not found", cur_file_name, (int) dpi); + luatex_warn("Font %s at %i not found", cur_file_name, (int) dpi); cur_file_name = NULL; return false; } diff --git a/Build/source/texk/web2c/luatexdir/font/writettf.w b/Build/source/texk/web2c/luatexdir/font/writettf.w index 93be125837b..2cab4b2371c 100644 --- a/Build/source/texk/web2c/luatexdir/font/writettf.w +++ b/Build/source/texk/web2c/luatexdir/font/writettf.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = - "$Id: writettf.w 4718 2014-01-02 15:35:31Z taco $" + "$Id: writettf.w 4847 2014-03-05 18:13:17Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writettf.w $"; #include "ptexlib.h" @@ -487,7 +487,7 @@ long ttf_getnum(int s) int c; while (s > 0) { if (ttf_eof()) - pdftex_fail("unexpected EOF"); + luatex_fail("unexpected EOF"); c = ttf_getchar(); i = (i << 8) + c; s--; @@ -517,7 +517,7 @@ dirtab_entry *ttf_name_lookup(const char *s, boolean required) break; if (tab - dir_tab == ntabs) { if (required) - pdftex_fail("can't find table `%s'", s); + luatex_fail("can't find table `%s'", s); else tab = NULL; } @@ -587,7 +587,7 @@ static void ttf_copy_encoding(void) e = ttfenc_tab + *q; e->code = charcodes[*q]; if (e->code == -1) - pdftex_warn + luatex_warn ("character %i in subfont %s is not mapped to any charcode", *q, fd_cur->fm->tfm_name); else { @@ -817,7 +817,7 @@ void ttf_read_post(void) } break; default: - pdftex_warn("unsupported format (%.8X) of `post' table, assuming 3.0", + luatex_warn("unsupported format (%.8X) of `post' table, assuming 3.0", (unsigned int) post_format); case 0x00030000: for (glyph = glyph_tab; glyph - glyph_tab < NMACGLYPHS; glyph++) { @@ -893,13 +893,13 @@ static ttf_cmap_entry *ttf_read_cmap(char *ttf_name, int pid, int eid, goto read_cmap_format_4; else { if (warn) - pdftex_warn("cmap format %i unsupported", format); + luatex_warn("cmap format %i unsupported", format); return NULL; } } } if (warn) - pdftex_warn("cannot find cmap subtable for (pid,eid) = (%i, %i)", + luatex_warn("cannot find cmap subtable for (pid,eid) = (%i, %i)", pid, eid); return NULL; read_cmap_format_4: @@ -950,10 +950,10 @@ static ttf_cmap_entry *ttf_read_cmap(char *ttf_name, int pid, int eid, index = (index + s->idDelta) & 0xFFFF; } if (index >= glyphs_count) - pdftex_fail("cmap: glyph index %li out of range [0..%i)", + luatex_fail("cmap: glyph index %li out of range [0..%i)", index, glyphs_count); if (p->table[i] != -1) - pdftex_warn + luatex_warn ("cmap: multiple glyphs are mapped to unicode %.4lX, " "only %li will be used (glyph %li being ignored)", i, p->table[i], index); @@ -999,7 +999,7 @@ static void ttf_reset_chksm(PDF pdf, dirtab_entry * tab) tmp_ulong = 0; tab->offset = (TTF_ULONG) ttf_offset(); if (tab->offset % 4 != 0) - pdftex_warn("offset of `%4.4s' is not a multiple of 4", tab->tag); + luatex_warn("offset of `%4.4s' is not a multiple of 4", tab->tag); } @@ -1035,7 +1035,7 @@ static void ttf_byte_encoding(PDF pdf) put_byte(e->newindex); } else { if (e->name != notdef) - pdftex_warn + luatex_warn ("glyph `%s' has been mapped to `%s' in `ttf_byte_encoding' cmap table", e->name, notdef); put_byte(0); /* notdef */ @@ -1124,7 +1124,7 @@ static void ttf_write_cmap(PDF pdf) offset += TRIMMED_TABLE_MAP_LENGTH; break; default: - pdftex_fail("invalid format (it should not have happened)"); + luatex_fail("invalid format (it should not have happened)"); } (void) put_ushort(ce->platform_id); (void) put_ushort(ce->encoding_id); @@ -1268,7 +1268,7 @@ static void ttf_write_dirtab(PDF pdf) } } if (i % 4 != 0) { - pdftex_warn("font length is not a multiple of 4 (%li)", i); + luatex_warn("font length is not a multiple of 4 (%li)", i); checksum <<= 8 * (4 - i % 4); } k = 0xB1B0AFBA - checksum; @@ -1365,7 +1365,7 @@ static void ttf_reindex_glyphs(void) t = cmap->table; assert(t != NULL && e->code < 0x10000); if (t[e->code] < 0) { - pdftex_warn + luatex_warn ("subfont %s: wrong mapping: character %li --> 0x%4.4lX --> .notdef", fd_cur->fm->tfm_name, (long) (e - ttfenc_tab), e->code); continue; @@ -1381,7 +1381,7 @@ static void ttf_reindex_glyphs(void) /* scan form `index123' */ if (sscanf(e->name, GLYPH_PREFIX_INDEX "%i", &index) == 1) { if (index >= glyphs_count) { - pdftex_warn("`%s' out of valid range [0..%i)", + luatex_warn("`%s' out of valid range [0..%i)", e->name, glyphs_count); continue; } @@ -1396,7 +1396,7 @@ static void ttf_reindex_glyphs(void) if (cmap == NULL) cmap = ttf_read_cmap(fd_cur->fm->ff_name, 0, 3, false); if (cmap == NULL) { - pdftex_warn + luatex_warn ("no unicode mapping found, all `uniXXXX' names will be ignored"); cmap_not_found = true; /* once only */ } @@ -1407,7 +1407,7 @@ static void ttf_reindex_glyphs(void) assert(t != NULL); if (t[index] != -1) { if (t[index] >= glyphs_count) { - pdftex_warn + luatex_warn ("`%s' is mapped to index %li which is out of valid range [0..%i)", e->name, t[index], glyphs_count); continue; @@ -1415,7 +1415,7 @@ static void ttf_reindex_glyphs(void) glyph = glyph_tab + t[index]; goto append_new_glyph; } else { - pdftex_warn("`unicode %s%.4X' is not mapped to any glyph", + luatex_warn("`unicode %s%.4X' is not mapped to any glyph", GLYPH_PREFIX_UNICODE, index); continue; } @@ -1425,7 +1425,7 @@ static void ttf_reindex_glyphs(void) if (glyph->name != notdef && strcmp(glyph->name, e->name) == 0) break; if (!(glyph - glyph_tab < glyphs_count)) { - pdftex_warn("glyph `%s' not found", e->name); + luatex_warn("glyph `%s' not found", e->name); continue; } append_new_glyph: @@ -1556,7 +1556,7 @@ static void ttf_write_OS2(PDF pdf) ttf_reset_chksm(pdf, tab); version = get_ushort(); if (version > 3) - pdftex_fail("unknown version of OS/2 table (%.4X)", version); + luatex_fail("unknown version of OS/2 table (%.4X)", version); (void) put_ushort(0x0001); /* fix version to 1 */ ttf_ncopy(pdf, 2 * TTF_USHORT_SIZE + 13 * TTF_SHORT_SIZE + 10 * TTF_BYTE_SIZE); @@ -1694,7 +1694,7 @@ void writettf(PDF pdf, fd_entry * fd) if (is_subsetted(fd_cur->fm) && (fd_cur->fe == NULL) && !is_subfont(fd_cur->fm)) { - pdftex_fail("Subset TrueType must be a reencoded or a subfont"); + luatex_fail("Subset TrueType must be a reencoded or a subfont"); } ttf_curbyte = 0; ttf_size = 0; @@ -1702,7 +1702,7 @@ void writettf(PDF pdf, fd_entry * fd) cur_file_name = luatex_find_file(fd_cur->fm->ff_name, find_truetype_file_callback); if (cur_file_name == NULL) { - pdftex_fail("cannot find TrueType font file for reading (%s)", fd_cur->fm->ff_name); + luatex_fail("cannot find TrueType font file for reading (%s)", fd_cur->fm->ff_name); } callback_id = callback_defined(read_truetype_file_callback); if (callback_id > 0) { @@ -1710,11 +1710,11 @@ void writettf(PDF pdf, fd_entry * fd) &file_opened, &ttf_buffer, &ttf_size) && file_opened && ttf_size > 0) { } else { - pdftex_fail("cannot open TrueType font file for reading (%s)", cur_file_name); + luatex_fail("cannot open TrueType font file for reading (%s)", cur_file_name); } } else { if (!ttf_open(cur_file_name)) { - pdftex_fail("cannot open TrueType font file for reading (%s)", cur_file_name); + luatex_fail("cannot open TrueType font file for reading (%s)", cur_file_name); } ttf_read_file(); ttf_close(); @@ -1807,7 +1807,7 @@ void writeotf(PDF pdf, fd_entry * fd) cur_file_name = luatex_find_file(fd_cur->fm->ff_name, find_opentype_file_callback); if (cur_file_name == NULL) { - pdftex_fail("cannot find OpenType font file for reading (%s)", fd_cur->fm->ff_name); + luatex_fail("cannot find OpenType font file for reading (%s)", fd_cur->fm->ff_name); } callback_id = callback_defined(read_opentype_file_callback); if (callback_id > 0) { @@ -1815,11 +1815,11 @@ void writeotf(PDF pdf, fd_entry * fd) &file_opened, &ttf_buffer, &ttf_size) && file_opened && ttf_size > 0) { } else { - pdftex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); + luatex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); } } else { if (!otf_open(cur_file_name)) { - pdftex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); + luatex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); } ttf_read_file(); ttf_close(); diff --git a/Build/source/texk/web2c/luatexdir/font/writetype0.w b/Build/source/texk/web2c/luatexdir/font/writetype0.w index 19bab05906f..1196899ba79 100644 --- a/Build/source/texk/web2c/luatexdir/font/writetype0.w +++ b/Build/source/texk/web2c/luatexdir/font/writetype0.w @@ -19,8 +19,8 @@ @ @c static const char _svn_version[] = - "$Id: writetype0.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/writetype0.w $"; + "$Id: writetype0.w 4847 2014-03-05 18:13:17Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writetype0.w $"; #include "ptexlib.h" #include "font/writettf.h" @@ -48,7 +48,7 @@ void writetype0(PDF pdf, fd_entry * fd) cur_file_name = luatex_find_file(fd_cur->fm->ff_name, find_opentype_file_callback); if (cur_file_name == NULL) { - pdftex_fail("cannot find OpenType font file for reading (%s)", + luatex_fail("cannot find OpenType font file for reading (%s)", fd_cur->fm->ff_name); } callback_id = callback_defined(read_opentype_file_callback); @@ -57,12 +57,12 @@ void writetype0(PDF pdf, fd_entry * fd) &file_opened, &ttf_buffer, &ttf_size) && file_opened && ttf_size > 0) { } else { - pdftex_fail("cannot open OpenType font file for reading (%s)", + luatex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); } } else { if (!otf_open(cur_file_name)) { - pdftex_fail("cannot open OpenType font file for reading (%s)", + luatex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); } ttf_read_file(); diff --git a/Build/source/texk/web2c/luatexdir/font/writetype2.w b/Build/source/texk/web2c/luatexdir/font/writetype2.w index b7c32f0616b..c2bdb97b152 100644 --- a/Build/source/texk/web2c/luatexdir/font/writetype2.w +++ b/Build/source/texk/web2c/luatexdir/font/writetype2.w @@ -19,8 +19,8 @@ @ @c static const char _svn_version[] = - "$Id: writetype2.w 4457 2012-07-13 13:16:19Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/writetype2.w $"; + "$Id: writetype2.w 4847 2014-03-05 18:13:17Z luigi $" + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writetype2.w $"; #include "ptexlib.h" #include "font/writettf.h" @@ -153,7 +153,7 @@ void writetype2(PDF pdf, fd_entry * fd) cur_file_name = luatex_find_file(fd_cur->fm->ff_name, find_opentype_file_callback); if (cur_file_name == NULL) { - pdftex_fail("cannot find OpenType font file for reading (%s)", fd_cur->fm->ff_name); + luatex_fail("cannot find OpenType font file for reading (%s)", fd_cur->fm->ff_name); } callback_id = callback_defined(read_opentype_file_callback); if (callback_id > 0) { @@ -161,11 +161,11 @@ void writetype2(PDF pdf, fd_entry * fd) &file_opened, &ttf_buffer, &ttf_size) && file_opened && ttf_size > 0) { } else { - pdftex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); + luatex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); } } else { if (!otf_open(cur_file_name)) { - pdftex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); + luatex_fail("cannot open OpenType font file for reading (%s)", cur_file_name); } ttf_read_file(); ttf_close(); |