Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Remove cutout for missing font file in PdfFile._embedTeXFont. #30036

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 12, 2025

Conversation

anntzer
Copy link
Contributor

@anntzer anntzer commented May 10, 2025

If fontfile is None, an error would already have been raised earlier in dviFontName (which explicitly checks for this case).

(The cutout in _embedTeXFont was introduced first, in ed0066f (2009), but support for that case appears to have been broken a bit later and the check in dviFontName was then introduced in 4fcc0e7 (2016) where it simply improved the clarity of the exception ultimately raised. -- attn @jkseppan, who wrote both commits?)

Noted in relation to #29807.

PR summary

PR checklist

If fontfile is None, an error would already have been raised earlier in
dviFontName (which explicitly checks for this case).

(The cutout in _embedTeXFont was introduced first, in ed0066f (2009),
but support for that case appears to have been broken a bit later and
the check in dviFontName was then introduced in 4fcc0e7 (2016) where it
simply improved the clarity of the exception ultimately raised.)
Copy link
Member

@jkseppan jkseppan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Reasons for the font to not exist include the pdftexDownloadBase14 option mentioned in this warning and fonts that lack a Type-1 version. My guess is that both are very rare cases, and the error message currently raised is probably good enough.

@timhoffm timhoffm merged commit 6db18d5 into matplotlib:main May 12, 2025
47 checks passed
@timhoffm timhoffm added this to the v3.11.0 milestone May 12, 2025
@anntzer anntzer deleted the texnofont branch May 13, 2025 05:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants