texlive[43773] Build/source/texk/web2c/pdftexdir: revert

commits+karl at tug.org commits+karl at tug.org
Thu Apr 13 04:17:33 CEST 2017


Revision: 43773
          http://tug.org/svn/texlive?view=revision&revision=43773
Author:   karl
Date:     2017-04-13 04:17:33 +0200 (Thu, 13 Apr 2017)
Log Message:
-----------
revert type3+encoding+unicode patch, unfortunately; more mapline checks

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
    trunk/Build/source/texk/web2c/pdftexdir/NEWS
    trunk/Build/source/texk/web2c/pdftexdir/mapfile.c
    trunk/Build/source/texk/web2c/pdftexdir/pdftex.defines
    trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
    trunk/Build/source/texk/web2c/pdftexdir/ptexlib.h
    trunk/Build/source/texk/web2c/pdftexdir/ptexmac.h
    trunk/Build/source/texk/web2c/pdftexdir/writefont.c
    trunk/Build/source/texk/web2c/pdftexdir/writet3.c

Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2017-04-13 02:13:37 UTC (rev 43772)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2017-04-13 02:17:33 UTC (rev 43773)
@@ -1,61 +1,28 @@
-2017-04-13  Karl Berry  <karl at tug.org>
+2017-04-12  Karl Berry  <karl at freefriends.org>
 
-	* 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  <kakuto at fuk.kindai.ac.jp>
+2017-04-12  Pali Roh\'ar <pali.rohar at gmail.com>
 
-	* mapfile.c (check_fm_entry): warn if only tfm name is specified
-	in a map entry for type3.
-
-2017-04-02  Pali Roh\'ar  <pali.rohar at gmail.com>
-
-	* writet3.c: output /ToUnicode object in /Font object, not
-	in /Encoding object.
-
-2017-04-01  Pali Roh\'ar  <pali.rohar at gmail.com>
-
-	* 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  <pali.rohar at gmail.com>
-
 	* ptexmac.h (set_subfont, unset_subfont, is_subfont): remove
-	duplicate macros.
+        these 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
-
 2017-03-29  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
-	* 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  <karl at tug.org>
 
-	* NEWS,
-	* pdftex_version.h,
-	* pdftex.web (pdftex_revision, pdftex_version_string):
-	version [1.40.]18 for TL17.
+        * NEWS,
+        * pdftex_version.h,
+        * pdftex.web (pdftex_revision, pdftex_version_string):
+        version [1.40.]18 for TL17.
 
-2017-03-16  Pali Roh\'ar  <pali.rohar at gmail.com>
-
-	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.
-
 2017-02-18  Heiko Oberdiek  <heiko.oberdiek at googlemail.com>
 
 	* pdftex.web (substr_of_str): move earlier.

Modified: trunk/Build/source/texk/web2c/pdftexdir/NEWS
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/NEWS	2017-04-13 02:13:37 UTC (rev 43772)
+++ trunk/Build/source/texk/web2c/pdftexdir/NEWS	2017-04-13 02:17:33 UTC (rev 43773)
@@ -1,6 +1,5 @@
 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",
@@ -7,8 +6,7 @@
     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)

Modified: trunk/Build/source/texk/web2c/pdftexdir/mapfile.c
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/mapfile.c	2017-04-13 02:13:37 UTC (rev 43772)
+++ trunk/Build/source/texk/web2c/pdftexdir/mapfile.c	2017-04-13 02:17:33 UTC (rev 43773)
@@ -288,20 +288,13 @@
         /* 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);
+                 fm->tfm_name ? 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);
-        a += 1;
     }
 
     /* TrueType fonts cannot be reencoded without subsetting */
@@ -309,7 +302,7 @@
         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 @@
         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,7 +321,8 @@
         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) {
@@ -335,7 +329,8 @@
         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 @@
         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 @@
             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 @@
     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)

Modified: trunk/Build/source/texk/web2c/pdftexdir/pdftex.defines
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/pdftex.defines	2017-04-13 02:13:37 UTC (rev 43772)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.defines	2017-04-13 02:17:33 UTC (rev 43773)
@@ -38,7 +38,6 @@
 
 { functions from mapfile.c }
 @define function hasfmentry();
- at define function isscalable();
 @define procedure checkextfm();
 @define procedure pdfmapfile();
 @define procedure pdfmapline();

Modified: trunk/Build/source/texk/web2c/pdftexdir/pdftex.web
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2017-04-13 02:13:37 UTC (rev 43772)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2017-04-13 02:17:33 UTC (rev 43773)
@@ -15731,7 +15731,7 @@
     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 @@
     {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 @@
     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

Modified: trunk/Build/source/texk/web2c/pdftexdir/ptexlib.h
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ptexlib.h	2017-04-13 02:13:37 UTC (rev 43772)
+++ trunk/Build/source/texk/web2c/pdftexdir/ptexlib.h	2017-04-13 02:17:33 UTC (rev 43773)
@@ -168,7 +168,6 @@
 
 /* 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 t1_free(void);
 
 /* writet3.c */
-extern void writet3(fm_entry *, int, internalfontnumber);
+extern void writet3(int, internalfontnumber);
 extern scaled getpkcharwidth(internalfontnumber, scaled);
 
 /* writettf.c */

Modified: trunk/Build/source/texk/web2c/pdftexdir/ptexmac.h
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ptexmac.h	2017-04-13 02:13:37 UTC (rev 43772)
+++ trunk/Build/source/texk/web2c/pdftexdir/ptexmac.h	2017-04-13 02:17:33 UTC (rev 43773)
@@ -155,7 +155,6 @@
 #  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 @@
 #  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 @@
 #  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 @@
 #  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

Modified: trunk/Build/source/texk/web2c/pdftexdir/writefont.c
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/writefont.c	2017-04-13 02:13:37 UTC (rev 43772)
+++ trunk/Build/source/texk/web2c/pdftexdir/writefont.c	2017-04-13 02:17:33 UTC (rev 43773)
@@ -666,8 +666,8 @@
 {
     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);
 }

Modified: trunk/Build/source/texk/web2c/pdftexdir/writet3.c
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/writet3.c	2017-04-13 02:13:37 UTC (rev 43772)
+++ trunk/Build/source/texk/web2c/pdftexdir/writet3.c	2017-04-13 02:17:33 UTC (rev 43773)
@@ -254,32 +254,8 @@
     return true;
 }
 
-static void remove_duplicate_glyph_names(char **g, const char *encname)
+void writet3(int objnum, internalfontnumber f)
 {
-    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)
-{
     static char t3_font_scale_str[] = "\\pdffontscale";
     int i;
     integer wptr, eptr, cptr;
@@ -286,9 +262,6 @@
     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++) {
@@ -295,10 +268,6 @@
         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 @@
         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 @@
     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 @@
         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 @@
                 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 @@
     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(">");



More information about the tex-live-commits mailing list