texlive[43667] Build/source/texk/web2c/pdftexdir: pdftexdir: Always

commits+kakuto at tug.org commits+kakuto at tug.org
Sat Apr 1 09:29:33 CEST 2017


Revision: 43667
          http://tug.org/svn/texlive?view=revision&revision=43667
Author:   kakuto
Date:     2017-04-01 09:29:32 +0200 (Sat, 01 Apr 2017)
Log Message:
-----------
pdftexdir: Always embed each bitmap font, even if it has an entry in a font-map file, with different size separately (Pali Roh\'ar)

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
    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

Modified: trunk/Build/source/texk/web2c/pdftexdir/ChangeLog
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2017-04-01 02:01:47 UTC (rev 43666)
+++ trunk/Build/source/texk/web2c/pdftexdir/ChangeLog	2017-04-01 07:29:32 UTC (rev 43667)
@@ -1,10 +1,16 @@
+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: 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. This way, each bitmap font is embedded separately,
-	thus rasterized by MF instead of geometrically scaling up.
+	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>

Modified: trunk/Build/source/texk/web2c/pdftexdir/mapfile.c
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/mapfile.c	2017-04-01 02:01:47 UTC (rev 43666)
+++ trunk/Build/source/texk/web2c/pdftexdir/mapfile.c	2017-04-01 07:29:32 UTC (rev 43667)
@@ -290,8 +290,7 @@
 
     /* if for non-Type3 font both ps_name and font file are missing,
        drop this entry */
-    if ((is_type1(fm) || is_truetype(fm) || is_opentype(fm))
-        && fm->ps_name == NULL && !is_fontfile(fm)) {
+    if (!is_type3(fm) && fm->ps_name == NULL && !is_fontfile(fm)) {
         if (warn)
             pdftex_warn
                 ("invalid entry for `%s': both ps_name and font file missing",
@@ -539,8 +538,13 @@
             set_opentype(fm);
         else
             set_type1(fm);
-    } else if (is_std_t1font(fm))
-        set_type1(fm);          /* assume a builtin font is Type1 */
+    } 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)
         goto bad_line;
     /*
@@ -624,6 +628,11 @@
     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-01 02:01:47 UTC (rev 43666)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.defines	2017-04-01 07:29:32 UTC (rev 43667)
@@ -38,6 +38,7 @@
 
 { 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-01 02:01:47 UTC (rev 43666)
+++ trunk/Build/source/texk/web2c/pdftexdir/pdftex.web	2017-04-01 07:29:32 UTC (rev 43667)
@@ -15731,7 +15731,7 @@
     s: integer;
 begin
     w := char_width(f)(char_info(f)(c));
-    if hasfmentry(f) then begin
+    if isscalable(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 hasfmentry(b) then
+        if not isscalable(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 hasfmentry(f) then begin
+    if isscalable(f) then begin
         i := head_tab[obj_type_font];
         while i <> 0 do begin
             k := obj_info(i);
-            if hasfmentry(k) and
+            if isscalable(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-01 02:01:47 UTC (rev 43666)
+++ trunk/Build/source/texk/web2c/pdftexdir/ptexlib.h	2017-04-01 07:29:32 UTC (rev 43667)
@@ -168,6 +168,7 @@
 
 /* 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);

Modified: trunk/Build/source/texk/web2c/pdftexdir/ptexmac.h
===================================================================
--- trunk/Build/source/texk/web2c/pdftexdir/ptexmac.h	2017-04-01 02:01:47 UTC (rev 43666)
+++ trunk/Build/source/texk/web2c/pdftexdir/ptexmac.h	2017-04-01 07:29:32 UTC (rev 43667)
@@ -155,6 +155,7 @@
 #  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)
@@ -163,6 +164,7 @@
 #  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)
@@ -171,6 +173,7 @@
 #  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)
@@ -179,6 +182,7 @@
 #  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-01 02:01:47 UTC (rev 43666)
+++ trunk/Build/source/texk/web2c/pdftexdir/writefont.c	2017-04-01 07:29:32 UTC (rev 43667)
@@ -666,7 +666,7 @@
 {
     fm_entry *fm;
     fm = hasfmentry(f) ? (fm_entry *) pdffontmap[f] : NULL;
-    if (fm == NULL || (fm->ps_name == NULL && fm->ff_name == NULL))
+    if (fm == NULL || is_type3(fm) || (fm->ps_name == NULL && fm->ff_name == NULL))
         writet3(fm, font_objnum, f);
     else
         create_fontdictionary(fm, font_objnum, f);



More information about the tex-live-commits mailing list