Avoid using MacRoman encoding. #11277
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
... as support for it may be missing in some alternate Python
implementations.
For fetching the postscript name of a font, we can just use
FT_Get_Postscript_Name (the .postscript_name attribute in FT2Font),
which is exactly implemented in the same way (see the private
sfnt_get_ps_name in the FreeType sources).
In ttfFontProperty, we are only looking for ASCII substrings (and
MacRoman is not a multibyte encoding), so any ASCII compatible encoding
works.
The only remaining instance of MacRoman is in the implementation of SVG
fonts in the SVG backend, but that feature is itself deprecated.
Alternate to #11263; attn @mdboom.
PR Summary
PR Checklist