diff options
author | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-12-10 09:22:25 +0000 |
---|---|---|
committer | Peter Breitenlohner <peb@mppmu.mpg.de> | 2014-12-10 09:22:25 +0000 |
commit | 70b9e104222eb5ba7a495c6267643c6470fb4667 (patch) | |
tree | 6b540c75177a4ec7d7ad0b607542c0f3620b1d3e /Build/source/texk/web2c/luatexdir/font | |
parent | db2683e88ae12a32ad6620b4e40218761ea14f41 (diff) |
LuaTeX: Sync with https://foundry.supelec.fr/svn/luatex/trunk r5092
git-svn-id: svn://tug.org/texlive/trunk@35779 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/font')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/dofont.w | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/luafont.w | 32 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/mapfile.w | 13 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/subfont.w | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/texfont.w | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/tounicode.w | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/tt_glyf.w | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writecff.w | 10 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writeenc.w | 2 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writefont.w | 5 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writet1.w | 4 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/font/writettf.w | 2 |
12 files changed, 56 insertions, 40 deletions
diff --git a/Build/source/texk/web2c/luatexdir/font/dofont.w b/Build/source/texk/web2c/luatexdir/font/dofont.w index bed6850c241..15688fd63e3 100644 --- a/Build/source/texk/web2c/luatexdir/font/dofont.w +++ b/Build/source/texk/web2c/luatexdir/font/dofont.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = "$Id: dofont.w 4524 2012-12-20 15:38:02Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/dofont.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/dofont.w $"; #include "ptexlib.h" #include "lua/luatex-api.h" diff --git a/Build/source/texk/web2c/luatexdir/font/luafont.w b/Build/source/texk/web2c/luatexdir/font/luafont.w index c64f6544ecb..089558c1314 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 4847 2014-03-05 18:13:17Z luigi $" + "$Id: luafont.w 5064 2014-10-13 12:47:11Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/luafont.w $"; #include "ptexlib.h" @@ -173,18 +173,24 @@ static void font_char_to_lua(lua_State * L, internal_font_number f, charinfo * c lua_pushnumber(L, get_charinfo_depth(co)); lua_rawset(L, -3); - lua_pushstring(L, "italic"); - lua_pushnumber(L, get_charinfo_italic(co)); - lua_rawset(L, -3); - lua_pushstring(L, "top_accent"); - lua_pushnumber(L, get_charinfo_top_accent(co)); - lua_rawset(L, -3); + if (get_charinfo_italic(co) != 0) { + lua_pushstring(L, "italic"); + lua_pushnumber(L, get_charinfo_italic(co)); + lua_rawset(L, -3); + } - lua_pushstring(L, "bot_accent"); - lua_pushnumber(L, get_charinfo_bot_accent(co)); - lua_rawset(L, -3); + if (get_charinfo_top_accent(co) !=0) { + lua_pushstring(L, "top_accent"); + lua_pushnumber(L, get_charinfo_top_accent(co)); + lua_rawset(L, -3); + } + if (get_charinfo_bot_accent(co) != 0) { + lua_pushstring(L, "bot_accent") ; + lua_pushnumber(L, get_charinfo_bot_accent(co)); + lua_rawset(L, -3); + } if (get_charinfo_ef(co) != 0) { lua_pushstring(L, "expansion_factor"); @@ -198,13 +204,12 @@ static void font_char_to_lua(lua_State * L, internal_font_number f, charinfo * c lua_rawset(L, -3); } - if (get_charinfo_lp(co) != 0) { + if (get_charinfo_rp(co) != 0) { lua_pushstring(L, "right_protruding"); lua_pushnumber(L, get_charinfo_rp(co)); lua_rawset(L, -3); } - if (font_encodingbytes(f) == 2) { lua_pushstring(L, "index"); lua_pushnumber(L, get_charinfo_index(co)); @@ -1441,6 +1446,7 @@ int font_from_lua(lua_State * L, int f) i = maketexstring(s); set_pdf_font_attr(f, i); } + free(s); i = n_enum_field(L, lua_key_index(type), unknown_font_type, font_type_strings); set_font_type(f, i); @@ -1480,6 +1486,8 @@ int font_from_lua(lua_State * L, int f) /* } */ /* lua_pop(L, 1); /\* pop name *\/ */ ss = n_string_field(L, lua_key_index(name)); + /* string is anchored */ + lua_pop(L,1); } if (ss != NULL) { /* lua_getfield(L, -1, "size"); */ diff --git a/Build/source/texk/web2c/luatexdir/font/mapfile.w b/Build/source/texk/web2c/luatexdir/font/mapfile.w index ff52ac5e6cc..d94189f4d6a 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 4956 2014-03-28 12:12:17Z luigi $" + "$Id: mapfile.w 5081 2014-11-07 18:38:33Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/mapfile.w $"; #include "ptexlib.h" @@ -337,7 +337,8 @@ static void fm_scan_line(void) float d; fm_entry *fm; char fm_line[FM_BUF_SIZE], buf[FM_BUF_SIZE]; - char *p, *q, *r, *s; + char *p, *q, *s; + char *r = NULL; switch (mitem->type) { case MAPFILE: p = fm_line; @@ -366,15 +367,15 @@ static void fm_scan_line(void) fm = new_fm_entry(); read_field(r, q, buf); set_field(tfm_name); - if (!isdigit((unsigned char)*r)) { /* 2nd field ps_name may not start with a digit */ + if (!isdigit(*r)) { /* 2nd field ps_name may not start with a digit */ read_field(r, q, buf); set_field(ps_name); } - if (isdigit((unsigned char)*r)) { /* font descriptor /Flags given? */ - for (s = r; isdigit((unsigned char)*s); s++); + if (isdigit(*r)) { /* font descriptor /Flags given? */ + for (s = r; isdigit(*s); s++); if (*s == ' ' || *s == '"' || *s == '<' || *s == '\0') { /* not e. g. 8r.enc */ fm->fd_flags = atoi(r); - while (isdigit((unsigned char)*r)) + while (isdigit(*r)) r++; } } diff --git a/Build/source/texk/web2c/luatexdir/font/subfont.w b/Build/source/texk/web2c/luatexdir/font/subfont.w index 06678c1e195..f35d601547a 100644 --- a/Build/source/texk/web2c/luatexdir/font/subfont.w +++ b/Build/source/texk/web2c/luatexdir/font/subfont.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = - "$Id: subfont.w 4847 2014-03-05 18:13:17Z luigi $" + "$Id: subfont.w 5017 2014-06-05 15:11:19Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/subfont.w $"; #include "ptexlib.h" @@ -40,7 +40,7 @@ static int sfd_curbyte = 0; #define sfd_read_file() readbinfile(sfd_file,&sfd_buffer,&sfd_size) #define sfd_getchar() sfd_buffer[sfd_curbyte++] -#define sfd_eof() (sfd_curbyte>sfd_size) +#define sfd_eof() (sfd_curbyte>=sfd_size) static FILE *sfd_file; @@ -102,9 +102,11 @@ static void sfd_getline(boolean expect_eof) char c; restart: if (sfd_eof()) { - if (expect_eof) + if (expect_eof) { + if (*sfd_line == '#') + *sfd_line = 10; return; - else + } else luatex_fail("unexpected end of file"); } p = sfd_line; diff --git a/Build/source/texk/web2c/luatexdir/font/texfont.w b/Build/source/texk/web2c/luatexdir/font/texfont.w index 6d2358349d3..65fdc6a332e 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 4847 2014-03-05 18:13:17Z luigi $" + "$Id: texfont.w 5081 2014-11-07 18:38:33Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/texfont.w $"; #include "ptexlib.h" @@ -1760,6 +1760,10 @@ void undump_font(int f) undump_things(*math_param_base(f), (font_math_params(f) + 1)); } + font_tables[f]->characters = new_sa_tree(1, 0); /* stack size 1, default item value 0 */ + ci = xcalloc(1, sizeof(charinfo)); + set_charinfo_name(ci, xstrdup(".notdef")); + font_tables[f]->charinfo = ci; undump_int(x); if (x) { i = undump_charinfo(f); @@ -1768,10 +1772,6 @@ void undump_font(int f) if (x) { i = undump_charinfo(f); } /* right boundary */ - font_tables[f]->characters = new_sa_tree(1, 0); /* stack size 1, default item value 0 */ - ci = xcalloc(1, sizeof(charinfo)); - set_charinfo_name(ci, xstrdup(".notdef")); - font_tables[f]->charinfo = ci; i = font_bc(f); while (i < font_ec(f)) { diff --git a/Build/source/texk/web2c/luatexdir/font/tounicode.w b/Build/source/texk/web2c/luatexdir/font/tounicode.w index 1ed589eb1ce..b33bef027a0 100644 --- a/Build/source/texk/web2c/luatexdir/font/tounicode.w +++ b/Build/source/texk/web2c/luatexdir/font/tounicode.w @@ -92,7 +92,7 @@ void def_tounicode(str_number glyph, str_number unistr) for (i = 0; i < l; i++) { if (p[i] == ' ') valid_unistr = 2; /* if a space occurs we treat this entry as a string */ - else if (!isXdigit((unsigned char)p[i])) { + else if (!isXdigit(p[i])) { valid_unistr = 0; break; } @@ -151,7 +151,7 @@ static long check_unicode_value(char *s, boolean multiple_value) return UNI_UNDEF; for (i = 0; i < l; i++) { - if (!isXdigit((unsigned char)s[i])) + if (!isXdigit(s[i])) return UNI_UNDEF; if (multiple_value) { if (i % 4 == 3) { diff --git a/Build/source/texk/web2c/luatexdir/font/tt_glyf.w b/Build/source/texk/web2c/luatexdir/font/tt_glyf.w index be0bf375b36..21ceba11e14 100644 --- a/Build/source/texk/web2c/luatexdir/font/tt_glyf.w +++ b/Build/source/texk/web2c/luatexdir/font/tt_glyf.w @@ -24,7 +24,7 @@ @ @c static const char _svn_version[] = "$Id: tt_glyf.w 4457 2012-07-13 13:16:19Z taco $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/tt_glyf.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/tt_glyf.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/font/writecff.w b/Build/source/texk/web2c/luatexdir/font/writecff.w index 3c9174d1aae..defe4b6841f 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 4956 2014-03-28 12:12:17Z luigi $" + "$Id: writecff.w 5041 2014-07-16 16:13:03Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writecff.w $"; #include "ptexlib.h" @@ -169,8 +169,10 @@ cff_index *cff_get_index_header(cff_font * cff) idx->offset = xmalloc((unsigned) (((unsigned) count + 1) * sizeof(l_offset))); - for (i = 0; i < count + 1; i++) { + for (i = 0; i <count + 1 ; i++) { (idx->offset)[i] = get_offset(cff, idx->offsize); + if (i == USHRT_MAX) + break; } if (idx->offset[0] != 1) @@ -3158,7 +3160,7 @@ void write_cff(PDF pdf, cff_font * cffont, fd_entry * fd) } /* build the new charstrings entry */ - charstrings = cff_new_index((card16) (cs_count1 + 1)); + charstrings = cff_new_index((card16) (cs_count1==USHRT_MAX?cs_count1: cs_count1 + 1)); max_len = 2 * CS_STR_LEN_MAX; charstrings->data = xcalloc((unsigned) max_len, sizeof(card8)); charstring_len = 0; @@ -3437,7 +3439,7 @@ void write_cid_cff(PDF pdf, cff_font * cffont, fd_entry * fd) fdselect->num_entries = 0; fdselect->data.ranges = xcalloc(num_glyphs, sizeof(cff_range3)); - charstrings = cff_new_index((card16) (cs_count1 + 1)); + charstrings = cff_new_index((card16) (cs_count1==USHRT_MAX?cs_count1: cs_count1 + 1)); max_len = 2 * CS_STR_LEN_MAX; charstrings->data = xcalloc((unsigned) max_len, sizeof(card8)); charstring_len = 0; diff --git a/Build/source/texk/web2c/luatexdir/font/writeenc.w b/Build/source/texk/web2c/luatexdir/font/writeenc.w index 1f769e667f2..476741e93aa 100644 --- a/Build/source/texk/web2c/luatexdir/font/writeenc.w +++ b/Build/source/texk/web2c/luatexdir/font/writeenc.w @@ -21,7 +21,7 @@ @ @c static const char _svn_version[] = "$Id: writeenc.w 4442 2012-05-25 22:40:34Z hhenkel $" - "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/font/writeenc.w $"; + "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writeenc.w $"; #include "ptexlib.h" diff --git a/Build/source/texk/web2c/luatexdir/font/writefont.w b/Build/source/texk/web2c/luatexdir/font/writefont.w index ff986bf86fe..3377059f304 100644 --- a/Build/source/texk/web2c/luatexdir/font/writefont.w +++ b/Build/source/texk/web2c/luatexdir/font/writefont.w @@ -20,7 +20,7 @@ @ @c static const char _svn_version[] = - "$Id: writefont.w 4847 2014-03-05 18:13:17Z luigi $" + "$Id: writefont.w 5081 2014-11-07 18:38:33Z luigi $" "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/font/writefont.w $"; #include "ptexlib.h" @@ -426,6 +426,9 @@ static void register_fo_entry(fo_entry * fo) static void write_fontfile(PDF pdf, fd_entry * fd) { assert(is_included(fd->fm)); + /* In principle we could replace the pdftex derived ttf.otf inclusion part */ + /* by using the regular code for this and assigning indices and tounicodes */ + /* to the character blobs, but for the moment we keep the current approach */ if (is_cidkeyed(fd->fm)) { if (is_opentype(fd->fm)) writetype0(pdf, fd); diff --git a/Build/source/texk/web2c/luatexdir/font/writet1.w b/Build/source/texk/web2c/luatexdir/font/writet1.w index 036c65ad9c3..2e65017d2f8 100644 --- a/Build/source/texk/web2c/luatexdir/font/writet1.w +++ b/Build/source/texk/web2c/luatexdir/font/writet1.w @@ -456,7 +456,7 @@ static float t1_scan_num(char *p, char **r) luatex_fail("a number expected: `%s'", t1_line_array); } if (r != NULL) { - for (; isdigit((unsigned char)*p) || *p == '.' || + for (; isdigit(*p) || *p == '.' || *p == 'e' || *p == 'E' || *p == '+' || *p == '-'; p++); *r = p; } @@ -1522,7 +1522,7 @@ static void t1_flush_cs(PDF pdf, boolean is_subr) t1_line_ptr = t1_line_array; for (p = start_line; p - start_line < size_pos;) *t1_line_ptr++ = *p++; - while (isdigit((unsigned char)*p)) + while (isdigit(*p)) p++; sprintf(t1_line_ptr, "%u", count); strcat(t1_line_ptr, p); diff --git a/Build/source/texk/web2c/luatexdir/font/writettf.w b/Build/source/texk/web2c/luatexdir/font/writettf.w index 169e1c20d81..2cab4b2371c 100644 --- a/Build/source/texk/web2c/luatexdir/font/writettf.w +++ b/Build/source/texk/web2c/luatexdir/font/writettf.w @@ -622,7 +622,7 @@ static char *strip_spaces_and_delims(char *s, int l) for (i = 0; i < l; s++, i++) { if (*s == '(' || *s == ')' || *s == '<' || *s == '>' || *s == '[' || *s == ']' || *s == '{' || *s == '}' || - *s == '/' || *s == '%' || isspace((unsigned char)*s)) + *s == '/' || *s == '%' || isspace(*s)) continue; *p++ = *s; } |