From 3ddc435153bf1510c537a803b80e9588699c71f0 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 13 Apr 2017 02:17:33 +0000 Subject: revert type3+encoding+unicode patch, unfortunately; more mapline checks git-svn-id: svn://tug.org/texlive/trunk@43773 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/web2c/pdftexdir/ChangeLog | 61 ++++++------------------ Build/source/texk/web2c/pdftexdir/NEWS | 4 +- Build/source/texk/web2c/pdftexdir/mapfile.c | 46 +++++++----------- Build/source/texk/web2c/pdftexdir/pdftex.defines | 1 - Build/source/texk/web2c/pdftexdir/pdftex.web | 8 ++-- Build/source/texk/web2c/pdftexdir/ptexlib.h | 3 +- Build/source/texk/web2c/pdftexdir/ptexmac.h | 4 -- Build/source/texk/web2c/pdftexdir/writefont.c | 4 +- Build/source/texk/web2c/pdftexdir/writet3.c | 59 ++--------------------- 9 files changed, 43 insertions(+), 147 deletions(-) (limited to 'Build') diff --git a/Build/source/texk/web2c/pdftexdir/ChangeLog b/Build/source/texk/web2c/pdftexdir/ChangeLog index 961d6f7f601..dd3c066de67 100644 --- a/Build/source/texk/web2c/pdftexdir/ChangeLog +++ b/Build/source/texk/web2c/pdftexdir/ChangeLog @@ -1,60 +1,27 @@ -2017-04-13 Karl Berry +2017-04-12 Karl Berry - * mapfile.c, pdftex.defines, ptexlib.h, ptexmac.h, writefont.c, - writepng.c: copyright updates, doc tweaks. + * mapfile.c (check_fm_entry): do not try to print fm->tfm_name, + etc., in warnings if null. + (fm_scan_line): goto bad_line if a null tfm_name, + even if check_fm_entry returns true. -2017-04-02 Akira Kakuto - - * mapfile.c (check_fm_entry): warn if only tfm name is specified - in a map entry for type3. - -2017-04-02 Pali Roh\'ar - - * writet3.c: output /ToUnicode object in /Font object, not - in /Encoding object. - -2017-04-01 Pali Roh\'ar - - * mapfile.c, ptexlib.h, ptexmac.h, writefont.c, pdftex.defines, - pdftex.web: Always embed each bitmap font, even if it has an entry - in a font-map file, with different size separately instead of - scaling geometrically. - -2017-03-30 Pali Roh\'ar +2017-04-12 Pali Roh\'ar * ptexmac.h (set_subfont, unset_subfont, is_subfont): remove - duplicate macros. - - * writet3.c (writet3): ensure fm is non-NULL before dereferencing. - * mapfile.c (check_fm_entry): omit check for is_reencoded, i.e., - an .enc file. - https://mailman.ntg.nl/pipermail/ntg-pdftex/2017-March/004125.html + these duplicate macros. 2017-03-29 Akira Kakuto - * writepng.c: Fix the size of memory to allocate when writing - SMask in write_png_rgb_alpha. Reported by David Fifield: - http://tug.org/pipermail/pdftex/2017-March/009100.html + * writepng.c: Fix the size of memory to allocate when writing + SMask in write_png_rgb_alpha. Reported by David Fifield: + http://tug.org/pipermail/pdftex/2017-March/009100.html 2017-03-18 Karl Berry - * NEWS, - * pdftex_version.h, - * pdftex.web (pdftex_revision, pdftex_version_string): - version [1.40.]18 for TL17. - -2017-03-16 Pali Roh\'ar - - Allow .enc files for bitmap fonts, following thread at - http://tug.org/pipermail/pdftex/2016-June/008980.html - http://tug.org/pipermail/pdftex/2016-July/009012.html: - * writet3.c (remove_duplicate_glyph_names): new fn. - (writet3): change fn to take fm_entry object, and use it to write - glyph names from an enc file, if specified in the map file. - (write_fontdictionary): - * ptexlib.h (writet3): change declaration. - * writefont.c (dopdffont): change call to writet3. - * mapfile.c (check_fm_entry): also report missing enc file. + * NEWS, + * pdftex_version.h, + * pdftex.web (pdftex_revision, pdftex_version_string): + version [1.40.]18 for TL17. 2017-02-18 Heiko Oberdiek diff --git a/Build/source/texk/web2c/pdftexdir/NEWS b/Build/source/texk/web2c/pdftexdir/NEWS index 16ab2304eaa..3a66ff8dd50 100644 --- a/Build/source/texk/web2c/pdftexdir/NEWS +++ b/Build/source/texk/web2c/pdftexdir/NEWS @@ -1,14 +1,12 @@ pdfTeX 3.14159265-2.6-1.40.18 (TeX Live 2017) - changes: - - encoding files can be specified for PK bitmap fonts on font map lines. - rename envvar SOURCE_DATE_EPOCH_TEX_PRIMITIVES to FORCE_SOURCE_DATE; no changes in functionality. - if the \pdfpageattr token list contains the string "/MediaBox", omitting output of the default /MediaBox. - bugfixes: - - \pdflastmatch more reliable when there was no match. - - avoid writing uninitialized memory with alpha-channel images. + - \pdflastmatch more reliable when there was no match --------------------------------------------------- pdfTeX 3.14159265-2.6-1.40.17 (TeX Live 2016) (May 20, 2016) diff --git a/Build/source/texk/web2c/pdftexdir/mapfile.c b/Build/source/texk/web2c/pdftexdir/mapfile.c index 733fce9ba87..6ae1bc1e78f 100644 --- a/Build/source/texk/web2c/pdftexdir/mapfile.c +++ b/Build/source/texk/web2c/pdftexdir/mapfile.c @@ -288,19 +288,12 @@ static int check_fm_entry(fm_entry * fm, boolean warn) /* do not set variable |a| as this entry will still be accepted */ } - /* if for non-Type3 font both ps_name and font file are missing, - drop this entry */ - if (!is_type3(fm) && fm->ps_name == NULL && !is_fontfile(fm)) { + /* if both ps_name and font file are missing, drop this entry */ + if (fm->ps_name == NULL && !is_fontfile(fm)) { if (warn) pdftex_warn ("invalid entry for `%s': both ps_name and font file missing", - fm->tfm_name); - a += 1; - } else if (is_type3(fm) && fm->encname == NULL) { - if (warn) - pdftex_warn - ("invalid entry for `%s': encoding file for type3 missing", - fm->tfm_name); + fm->tfm_name ? fm->tfm_name : ""); a += 1; } @@ -309,7 +302,7 @@ static int check_fm_entry(fm_entry * fm, boolean warn) if (warn) pdftex_warn ("invalid entry for `%s': only subsetted TrueType font can be reencoded", - fm->tfm_name); + fm->tfm_name ? fm->tfm_name : ""); a += 2; } @@ -319,7 +312,7 @@ static int check_fm_entry(fm_entry * fm, boolean warn) if (warn) pdftex_warn ("invalid entry for `%s': SlantFont/ExtendFont can be used only with embedded Type1 fonts", - fm->tfm_name); + fm->tfm_name ? fm->tfm_name : ""); a += 4; } @@ -328,14 +321,16 @@ static int check_fm_entry(fm_entry * fm, boolean warn) if (warn) pdftex_warn ("invalid entry for `%s': too big value of SlantFont (%g)", - fm->tfm_name, fm->slant / 1000.0); + fm->tfm_name ? fm->tfm_name : "", + fm->slant ? fm->slant / 1000.0 : 0); a += 8; } if (abs(fm->extend) > 2000) { if (warn) pdftex_warn ("invalid entry for `%s': too big value of ExtendFont (%g)", - fm->tfm_name, fm->extend / 1000.0); + fm->tfm_name ? fm->tfm_name : "", + fm->extend ? fm->extend / 1000.0 : 0); a += 16; } @@ -345,7 +340,7 @@ static int check_fm_entry(fm_entry * fm, boolean warn) if (warn) pdftex_warn ("invalid entry for `%s': PidEid can be used only with subsetted non-reencoded TrueType fonts", - fm->tfm_name); + fm->tfm_name ? fm->tfm_name : ""); a += 32; } @@ -544,17 +539,15 @@ static void fm_scan_line(void) set_opentype(fm); else set_type1(fm); - } else { - if (is_std_t1font(fm)) { - set_type1(fm); /* assume a builtin font is Type1 */ - } else { - set_type3(fm); /* otherwise font is Type3 */ - } - } - if (check_fm_entry(fm, true) != 0) + } else + set_type1(fm); /* assume a builtin font is Type1 */ + + /* If the input is devious, check_fm_entry may not recognize a + problem. Check that we have a tfm_name in any case. */ + if (check_fm_entry(fm, true) != 0 || ! fm->tfm_name) goto bad_line; /* - Until here the map line has been completely scanned without errors; + If we get here, the map line has been completely scanned without errors; fm points to a valid, freshly filled-out fm_entry structure. Now follows the actual work of registering/deleting. */ @@ -634,11 +627,6 @@ boolean hasfmentry(internalfontnumber f) return pdffontmap[f] != (fmentryptr) dummy_fm_entry(); } -boolean isscalable(internalfontnumber f) -{ - return hasfmentry(f) && (!is_type3((fm_entry *)pdffontmap[f])); -} - /* check whether a map entry is valid for font replacement */ static boolean fm_valid_for_font_replacement(fm_entry * fm) diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.defines b/Build/source/texk/web2c/pdftexdir/pdftex.defines index d9503f28c0f..192151364ca 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftex.defines +++ b/Build/source/texk/web2c/pdftexdir/pdftex.defines @@ -38,7 +38,6 @@ with this program. If not, see . { functions from mapfile.c } @define function hasfmentry(); -@define function isscalable(); @define procedure checkextfm(); @define procedure pdfmapfile(); @define procedure pdfmapline(); diff --git a/Build/source/texk/web2c/pdftexdir/pdftex.web b/Build/source/texk/web2c/pdftexdir/pdftex.web index b74cc416237..a00d8d408ac 100644 --- a/Build/source/texk/web2c/pdftexdir/pdftex.web +++ b/Build/source/texk/web2c/pdftexdir/pdftex.web @@ -15731,7 +15731,7 @@ var w, s_out: scaled; s: integer; begin w := char_width(f)(char_info(f)(c)); - if isscalable(f) then begin + if hasfmentry(f) then begin if pdf_cur_Tm_a = 0 then begin call_func(divide_scaled(w, pdf_font_size[f], 4)); pdf_delta_h := pdf_delta_h + scaled_out; @@ -15942,7 +15942,7 @@ begin {if |f| is auto expanded then ensure the base font is initialized} if pdf_font_auto_expand[f] and (pdf_font_blink[f] <> null_font) then begin b := pdf_font_blink[f]; - if not isscalable(b) then + if not hasfmentry(b) then pdf_error("font expansion", "auto expansion is only possible with scalable fonts"); if not font_used[b] then pdf_init_font(b); @@ -15953,11 +15953,11 @@ begin here: 1) |f| and |k| have the same tfm name (so they have been loaded at different sizes, eg 'cmr10' and 'cmr10 at 11pt'); 2) |f| has been auto expanded from |k|} - if isscalable(f) then begin + if hasfmentry(f) then begin i := head_tab[obj_type_font]; while i <> 0 do begin k := obj_info(i); - if isscalable(k) and + if hasfmentry(k) and (pdf_font_map[k] = pdf_font_map[f]) and (str_eq_str(font_name[k], font_name[f]) or (pdf_font_auto_expand[f] and diff --git a/Build/source/texk/web2c/pdftexdir/ptexlib.h b/Build/source/texk/web2c/pdftexdir/ptexlib.h index 2b03609c86e..becf40e96b2 100644 --- a/Build/source/texk/web2c/pdftexdir/ptexlib.h +++ b/Build/source/texk/web2c/pdftexdir/ptexlib.h @@ -168,7 +168,6 @@ extern const char *ptexbanner; /* mapfile.c */ extern boolean hasfmentry(internalfontnumber); -extern boolean isscalable(internalfontnumber); extern void fm_free(void); extern void fm_read_info(void); extern ff_entry *check_ff_exist(char *, boolean); @@ -308,7 +307,7 @@ extern void writet1(fd_entry *); extern void t1_free(void); /* writet3.c */ -extern void writet3(fm_entry *, int, internalfontnumber); +extern void writet3(int, internalfontnumber); extern scaled getpkcharwidth(internalfontnumber, scaled); /* writettf.c */ diff --git a/Build/source/texk/web2c/pdftexdir/ptexmac.h b/Build/source/texk/web2c/pdftexdir/ptexmac.h index 59e86e2b001..6b9a4ea5e64 100644 --- a/Build/source/texk/web2c/pdftexdir/ptexmac.h +++ b/Build/source/texk/web2c/pdftexdir/ptexmac.h @@ -155,7 +155,6 @@ size_t T##_limit # define F_TYPE1 0x10 # define F_TRUETYPE 0x20 # define F_OTF 0x40 -# define F_TYPE3 0x80 # define set_included(fm) ((fm)->type |= F_INCLUDED) # define set_subsetted(fm) ((fm)->type |= F_SUBSETTED) @@ -164,7 +163,6 @@ size_t T##_limit # 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_type3(fm) ((fm)->type |= F_TYPE3) # define unset_included(fm) ((fm)->type &= ~F_INCLUDED) # define unset_subsetted(fm) ((fm)->type &= ~F_SUBSETTED) @@ -173,7 +171,6 @@ size_t T##_limit # 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_type3(fm) ((fm)->type &= ~F_TYPE3) # define is_included(fm) (((fm)->type & F_INCLUDED) != 0) # define is_subsetted(fm) (((fm)->type & F_SUBSETTED) != 0) @@ -182,7 +179,6 @@ size_t T##_limit # 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_type3(fm) (((fm)->type & F_TYPE3) != 0) # define fm_slant(fm) (fm)->slant # define fm_extend(fm) (fm)->extend diff --git a/Build/source/texk/web2c/pdftexdir/writefont.c b/Build/source/texk/web2c/pdftexdir/writefont.c index 4b8490eb3b4..45e0269fade 100644 --- a/Build/source/texk/web2c/pdftexdir/writefont.c +++ b/Build/source/texk/web2c/pdftexdir/writefont.c @@ -666,8 +666,8 @@ void dopdffont(integer font_objnum, internalfontnumber f) { fm_entry *fm; fm = hasfmentry(f) ? (fm_entry *) pdffontmap[f] : NULL; - if (fm == NULL || is_type3(fm) || (fm->ps_name == NULL && fm->ff_name == NULL)) - writet3(fm, font_objnum, f); + if (fm == NULL || (fm->ps_name == NULL && fm->ff_name == NULL)) + writet3(font_objnum, f); else create_fontdictionary(fm, font_objnum, f); } diff --git a/Build/source/texk/web2c/pdftexdir/writet3.c b/Build/source/texk/web2c/pdftexdir/writet3.c index 936d4591c79..3348dff5cff 100644 --- a/Build/source/texk/web2c/pdftexdir/writet3.c +++ b/Build/source/texk/web2c/pdftexdir/writet3.c @@ -254,31 +254,7 @@ static boolean writepk(internalfontnumber f) return true; } -static void remove_duplicate_glyph_names(char **g, const char *encname) -{ - struct avl_table *gl_tree; - char *aa; - int i; - gl_tree = avl_create(comp_string_entry, NULL, &avl_xallocator); - assert(gl_tree != NULL); - for (i = 0; i < 256; i++) { - if (g[i] == notdef) - continue; - aa = (char *) avl_find(gl_tree, g[i]); - if (aa == NULL) { - aa = (char *) avl_probe(gl_tree, g[i]); - assert(aa != NULL); - } else { - pdftex_warn("%s: duplicate glyph name `%s' at position %d", - encname, g[i], i); - xfree(g[i]); - g[i] = (char *) notdef; - } - } - avl_destroy(gl_tree, NULL); -} - -void writet3(fm_entry * fm, int objnum, internalfontnumber f) +void writet3(int objnum, internalfontnumber f) { static char t3_font_scale_str[] = "\\pdffontscale"; int i; @@ -286,19 +262,12 @@ void writet3(fm_entry * fm, int objnum, internalfontnumber f) int first_char, last_char; integer pk_font_scale; boolean is_notdef; - fe_entry *fe; - char **glyph_names; - integer tounicode_objnum; t3_glyph_num = 0; t3_image_used = false; for (i = 0; i < 256; i++) { t3_char_procs[i] = 0; t3_char_widths[i] = 0; } - fe = fm && fm->encname ? get_fe_entry(fm->encname) : NULL; - glyph_names = fe ? fe->glyph_names : NULL; - if (glyph_names) - remove_duplicate_glyph_names(glyph_names, fm->encname); packfilename(fontname[f], getnullstr(), maketexstring(".pgc")); cur_file_name = makecstring(makenamestring()); is_pk_font = false; @@ -329,11 +298,6 @@ void writet3(fm_entry * fm, int objnum, internalfontnumber f) if (pdfcharmarked(f, i)) break; last_char = i; - /* write ToUnicode entry if needed */ - if (fixedgentounicode > 0 && !pdffontnobuiltintounicode[f] && fe != NULL) - tounicode_objnum = write_tounicode(glyph_names, fm->tfm_name,fe->name); - else - tounicode_objnum = 0; pdfbegindict(objnum, 1); /* Type 3 font dictionary */ pdf_puts("/Type /Font\n/Subtype /Type3\n"); pdf_printf("/Name /F%i\n", (int) f); @@ -362,8 +326,6 @@ void writet3(fm_entry * fm, int objnum, internalfontnumber f) cptr = pdfnewobjnum(); pdf_printf("/Widths %i 0 R\n/Encoding %i 0 R\n/CharProcs %i 0 R\n", (int) wptr, (int) eptr, (int) cptr); - if (tounicode_objnum != 0) - pdf_printf("/ToUnicode %i 0 R\n", (int) tounicode_objnum); pdfenddict(); pdfbeginobj(wptr, 1); /* chars width array */ pdf_puts("["); @@ -382,12 +344,7 @@ void writet3(fm_entry * fm, int objnum, internalfontnumber f) pdf_printf("/%s", notdef); is_notdef = true; } else { - if (glyph_names - && glyph_names[first_char] - && glyph_names[first_char] != notdef) - pdf_printf("/%s", glyph_names[first_char]); - else - pdf_printf("/a%i", first_char); + pdf_printf("/a%i", first_char); is_notdef = false; } for (i = first_char + 1; i <= last_char; i++) { @@ -401,10 +358,7 @@ void writet3(fm_entry * fm, int objnum, internalfontnumber f) pdf_printf(" %i", i); is_notdef = false; } - if (glyph_names && glyph_names[i] && glyph_names[i] != notdef) - pdf_printf("/%s", glyph_names[i]); - else - pdf_printf("/a%i", i); + pdf_printf("/a%i", i); } } pdf_puts("]\n"); @@ -412,12 +366,7 @@ void writet3(fm_entry * fm, int objnum, internalfontnumber f) pdfbegindict(cptr, 1); /* CharProcs dictionary */ for (i = first_char; i <= last_char; i++) if (t3_char_procs[i] != 0) - if (glyph_names && glyph_names[i] && glyph_names[i] != notdef) - pdf_printf("/%s %i 0 R\n", glyph_names[i], - (int) t3_char_procs[i]); - else - pdf_printf("/a%i %i 0 R\n", (int) i, - (int) t3_char_procs[i]); + pdf_printf("/a%i %i 0 R\n", (int) i, (int) t3_char_procs[i]); pdfenddict(); t3_close(); tex_printf(">"); -- cgit v1.2.3