diff options
author | Karl Berry <karl@freefriends.org> | 2018-03-14 22:52:12 +0000 |
---|---|---|
committer | Karl Berry <karl@freefriends.org> | 2018-03-14 22:52:12 +0000 |
commit | e874f7c7c1483bcf3680a1c659bad73fa942fe60 (patch) | |
tree | 0b77b92a72b6df67d332432f41b30eaa77a3608e | |
parent | 7ddb36376cada699f0a26f00ace2e15809fca57a (diff) |
separate successful glyph searches and filling in return structs
git-svn-id: svn://tug.org/texlive/trunk@46964 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/kpathsea/ChangeLog | 6 | ||||
-rw-r--r-- | Build/source/texk/kpathsea/tex-glyph.c | 27 |
2 files changed, 20 insertions, 13 deletions
diff --git a/Build/source/texk/kpathsea/ChangeLog b/Build/source/texk/kpathsea/ChangeLog index 01547b41e49..363bf0ee4f4 100644 --- a/Build/source/texk/kpathsea/ChangeLog +++ b/Build/source/texk/kpathsea/ChangeLog @@ -1,3 +1,9 @@ +2018-03-14 Karl Berry <karl@tug.org> + + * tex-glyph.c (kpathsea_find_glyph, try_size): disentangle + successful searches and filling in return information. + Private report from Doug McKenna, 14 Mar 2018 11:51:29. + 2018-02-26 Karl Berry <karl@freefriends.org> * texmf.cnf (TEXMFVAR, TEXMFCONFIG, doc): 2018. diff --git a/Build/source/texk/kpathsea/tex-glyph.c b/Build/source/texk/kpathsea/tex-glyph.c index c98a17edf47..9af2aabfce0 100644 --- a/Build/source/texk/kpathsea/tex-glyph.c +++ b/Build/source/texk/kpathsea/tex-glyph.c @@ -101,18 +101,18 @@ try_size (kpathsea kpse, const_string fontname, unsigned dpi, ret = try_pk ? try_format (kpse, kpse_pk_format) : NULL; format_found = kpse_pk_format; - if (ret == NULL && try_gf) - { - ret = try_format (kpse, kpse_gf_format); - format_found = kpse_gf_format; - } + if (ret == NULL && try_gf) { + ret = try_format (kpse, kpse_gf_format); + format_found = kpse_gf_format; + } - if (ret != NULL && glyph_file) - { /* Success. Fill in the return info. */ + if (ret != NULL) { /* Success. */ + if (glyph_file) { /* Fill in the return info. */ glyph_file->name = fontname; glyph_file->dpi = dpi; glyph_file->format = format_found; } + } return ret; } @@ -290,15 +290,16 @@ kpathsea_find_glyph (kpathsea kpse, /* If mktex... succeeded, set return struct. Doesn't make sense for `kpse_make_tex' to set it, since it can only succeed or fail, unlike the other routines. */ - if (ret && glyph_file) { - KPSE_GLYPH_FILE_DPI (*glyph_file) = dpi; - KPSE_GLYPH_FILE_NAME (*glyph_file) = fontname; - } + if (ret) { + if (glyph_file) { + KPSE_GLYPH_FILE_DPI (*glyph_file) = dpi; + KPSE_GLYPH_FILE_NAME (*glyph_file) = fontname; + } /* If mktex... failed, try any fallback resolutions. */ - else { + } else { if (kpse->fallback_resolutions) - ret = try_fallback_resolutions (kpse, fontname, dpi, format, glyph_file); + ret = try_fallback_resolutions (kpse, fontname, dpi,format,glyph_file); /* We're down to the font of last resort. */ if (!ret && kpse->fallback_font) { |