texlive[62589] Build/source/texk/dvipsk: use full path for tfm

commits+karl at tug.org commits+karl at tug.org
Thu Mar 10 16:54:52 CET 2022


Revision: 62589
          http://tug.org/svn/texlive?view=revision&revision=62589
Author:   karl
Date:     2022-03-10 16:54:52 +0100 (Thu, 10 Mar 2022)
Log Message:
-----------
use full path for tfm lookups, as with pk

Modified Paths:
--------------
    trunk/Build/source/texk/dvipsk/ChangeLog
    trunk/Build/source/texk/dvipsk/NEWS
    trunk/Build/source/texk/dvipsk/loadfont.c
    trunk/Build/source/texk/dvipsk/tfmload.c

Modified: trunk/Build/source/texk/dvipsk/ChangeLog
===================================================================
--- trunk/Build/source/texk/dvipsk/ChangeLog	2022-03-10 14:03:16 UTC (rev 62588)
+++ trunk/Build/source/texk/dvipsk/ChangeLog	2022-03-10 15:54:52 UTC (rev 62589)
@@ -1,3 +1,10 @@
+2022-03-10  Karl Berry  <karl at freefriends.org>
+
+	* tfmload.c (tfmopen): include area when searching, as with pkopen.
+	Report from Igor Liferenko, 9 Mar 2022 13:43:48.
+	
+	* loadfont.c (pkopen): "PK font" in error message when not found.
+
 2022-02-27  TANAKA Takuji  <ttk at t-lab.opal.ne.jp>
 
 	* tfmload.c:

Modified: trunk/Build/source/texk/dvipsk/NEWS
===================================================================
--- trunk/Build/source/texk/dvipsk/NEWS	2022-03-10 14:03:16 UTC (rev 62588)
+++ trunk/Build/source/texk/dvipsk/NEWS	2022-03-10 15:54:52 UTC (rev 62589)
@@ -3,10 +3,11 @@
 
 dvips 2022.1 (TeX Live 2022):
   New option (and config file directive) -landscaperotate: try to
-  automatically match rotated page content and paper sizes; in the past,
-  this was done by default, but it is generally unnecessary nowadays,
-  and can be troublesome when converting to PDF, so now the default is
-  not to do this. This option re-enables the rotated matching.
+    automatically match rotated page content and paper sizes; in the past,
+    this was done by default, but it is generally unnecessary nowadays,
+    and can be troublesome when converting to PDF, so now the default is
+    not to do this. This option re-enables the rotated matching.
+  Use full font path (if specified) for tfm lookups, as with pk.
 
 dvips 2021.1 (TeX Live 2021):
   Default title is now the basename of the input file instead of the
@@ -15,8 +16,8 @@
   Support new feature of virtual font to fallback Japanese font definition.
 
 dvips 2020.1 (TeX Live 2020):
-  Encodings for bitmap fonts.
-  https://tug.org/TUGboat/tb40-2/tb125rokicki-type3search.pdf
+  Encodings for bitmap fonts:
+    https://tug.org/TUGboat/tb40-2/tb125rokicki-type3search.pdf
   
 dvips 5.999 (TeX Live 2019):
   Buffer overflows.

Modified: trunk/Build/source/texk/dvipsk/loadfont.c
===================================================================
--- trunk/Build/source/texk/dvipsk/loadfont.c	2022-03-10 14:03:16 UTC (rev 62588)
+++ trunk/Build/source/texk/dvipsk/loadfont.c	2022-03-10 15:54:52 UTC (rev 62589)
@@ -138,7 +138,7 @@
      pkfile = pksearch(this_name, READBIN, fd->dpi, &name_ret, &dpi_ret);
 
      if (!pkfile || !FILESTRCASEEQ (this_name, name_ret)) {
-       char *msg = concatn ("Font ", fd->area, n, " not found; ", NULL);
+       char *msg = concatn ("PK font ", fd->area, n, " not found; ", NULL);
        /* wasting some memory */
        if (!pkfile)
          msg = concat (msg, "characters will be left blank.");

Modified: trunk/Build/source/texk/dvipsk/tfmload.c
===================================================================
--- trunk/Build/source/texk/dvipsk/tfmload.c	2022-03-10 14:03:16 UTC (rev 62588)
+++ trunk/Build/source/texk/dvipsk/tfmload.c	2022-03-10 15:54:52 UTC (rev 62589)
@@ -26,64 +26,47 @@
 }
 
 /*
- *   Tries to open a tfm file.  Uses cmr10.tfm if unsuccessful,
- *   and complains loudly about it.
+ *   Tries to open a tfm file in FD.  Uses cmr10.tfm if unsuccessful,
+ *   and complains loudly about it.  No return, sets tfmfile global.
  */
 void
 tfmopen(register fontdesctype *fd)
 {
-   register char *n;
-#ifdef KPATHSEA
+   char *full_name;
    kpse_file_format_type d;
-#else
-   register char *d;
-#endif
-   n = fd->name;
-   if (strlen(n) + 6 >= sizeof (name)) {
-      /* 6 for tfm() + null */
-      error("! TFM file name too long in tfmopen") ;
-   }
-   if (!noomega) {
-#ifdef KPATHSEA
+   char *stem_name = concat(fd->area, fd->name);
+   
+   if (!noomega) { /* search for .ofm first */
+      full_name = concat(stem_name, ".ofm");
       d = ofmpath;
-#else
-      d = fd->area;
-      if (*d==0)
-        d = ofmpath;
-#endif
-#ifdef MVSXA   /* IBM: MVS/XA */
-      sprintf(name, "ofm(%s)", n);
-#else
-      sprintf(name, "%s.ofm", n);
-#endif
-      if ((tfmfile=search(d, name, READBIN))!=NULL)
+      if ((tfmfile = search(d, full_name, READBIN)) != NULL) {
+         free(stem_name);
+         free(full_name);
          return;
+      }
+      free(full_name);
    }
-#ifdef KPATHSEA
+
+   /* try tfm */
    d = tfmpath;
-#else
-   d = fd->area;
-   if (*d==0)
-     d = tfmpath;
-#endif
-#ifdef MVSXA   /* IBM: MVS/XA */
-   sprintf(name, "tfm(%s)", n);
-#else
-   sprintf(name, "%s.tfm", n);
-#endif
-   if ((tfmfile=search(d, name, READBIN))!=NULL)
+   full_name = concat(stem_name, ".tfm");
+   if ((tfmfile = search(d, full_name, READBIN)) != NULL) {
+      free(stem_name);
+      free(full_name);
       return;
-   sprintf(errbuf, "Can't open font metric file %.500s%.500s",
-          fd->area, name);
+   }
+   sprintf(errbuf, "Can't open font metric file %.999s", full_name);
    error(errbuf);
+   
    error("I will use cmr10.tfm instead, so expect bad output.");
-#ifdef MVSXA   /* IBM: MVS/XA */
-   if ((tfmfile=search(d, "tfm(cmr10)", READBIN))!=NULL)
-#else
-   if ((tfmfile=search(d, "cmr10.tfm", READBIN))!=NULL)
-#endif
+   if ((tfmfile=search(d, "cmr10.tfm", READBIN)) != NULL) {
+      free(stem_name);
+      free(full_name);
       return;
+   }
+
    error("! I can't find cmr10.tfm; please reinstall me with proper paths");
+   free(stem_name);
 }
 
 static shalfword



More information about the tex-live-commits mailing list.