From a075b645de4cbd910f0af2a432ffcf4c492a1617 Mon Sep 17 00:00:00 2001 From: Karl Berry Date: Thu, 10 Mar 2022 15:54:52 +0000 Subject: use full path for tfm lookups, as with pk git-svn-id: svn://tug.org/texlive/trunk@62589 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipsk/ChangeLog | 7 ++++ Build/source/texk/dvipsk/NEWS | 13 +++---- Build/source/texk/dvipsk/loadfont.c | 2 +- Build/source/texk/dvipsk/tfmload.c | 71 ++++++++++++++----------------------- 4 files changed, 42 insertions(+), 51 deletions(-) (limited to 'Build/source/texk/dvipsk') diff --git a/Build/source/texk/dvipsk/ChangeLog b/Build/source/texk/dvipsk/ChangeLog index 4d8ef6bc155..517915f10d2 100644 --- a/Build/source/texk/dvipsk/ChangeLog +++ b/Build/source/texk/dvipsk/ChangeLog @@ -1,3 +1,10 @@ +2022-03-10 Karl Berry + + * 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 * tfmload.c: diff --git a/Build/source/texk/dvipsk/NEWS b/Build/source/texk/dvipsk/NEWS index 91501d0fded..8fff2070587 100644 --- a/Build/source/texk/dvipsk/NEWS +++ b/Build/source/texk/dvipsk/NEWS @@ -3,10 +3,11 @@ This file records noteworthy changes. (Public domain.) 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 @@ dvips 2021.1 (TeX Live 2021): 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. diff --git a/Build/source/texk/dvipsk/loadfont.c b/Build/source/texk/dvipsk/loadfont.c index f6d151dfd17..ccc705a5e8f 100644 --- a/Build/source/texk/dvipsk/loadfont.c +++ b/Build/source/texk/dvipsk/loadfont.c @@ -138,7 +138,7 @@ pkopen(register fontdesctype *fd) 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."); diff --git a/Build/source/texk/dvipsk/tfmload.c b/Build/source/texk/dvipsk/tfmload.c index 0c721bbebc2..722c9f5ada5 100644 --- a/Build/source/texk/dvipsk/tfmload.c +++ b/Build/source/texk/dvipsk/tfmload.c @@ -26,64 +26,47 @@ badtfm(const char *s) } /* - * 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 -- cgit v1.2.3