Improvements to make_icons.py.#14941
Conversation
- Auto-download and cache fontawesome otf. - Support writing results to another directory (useful when testing, to not mess with the repo). Also, support for pathlib in font_manager (made necessary by the changes in make_icons.py -- specifically, backend_pdf's internals don't handle FontProperties.get_fname returning a Path).
timhoffm
left a comment
There was a problem hiding this comment.
Just so that it has been said: This does not generate .ppm files anymore, which is fine by me.
| fig.patch.set_alpha(0.0) | ||
| text = fig.text(0.5, 0.48, chr(ccode), ha='center', va='center', | ||
| fontproperties=prop) | ||
| text.set_path_effects([patheffects.Normal()]) |
There was a problem hiding this comment.
I assume this did not have any effect, so removing is fine?
There was a problem hiding this comment.
The intent was probably to force the text to be rendered as a bezier rather than relying on a font file that may not exist in the end user's computer, but we set svg.fonttype to path so that also does the conversion, and the pdf backend takes care of embedding the font, so we should be good?
There was a problem hiding this comment.
I don't understand the details here, so relying on your investigation. But your question mark makes me wonder how sure you are...
There was a problem hiding this comment.
Looking at the code of patheffects.py I'm fairly confident that the description is correct, but to know what the original intent was, we would need to get @mdboom's input, if he still lurks aroud...
timhoffm
left a comment
There was a problem hiding this comment.
Looks good (modulo the patheffects removal). Personally, I'd be defensive and leave this in because I don't understand that. But @tacaswell has approved and if you think, this is fine we can also go as is.
not mess with the repo).
Also, support for pathlib in font_manager (made necessary by the changes
in make_icons.py -- specifically, backend_pdf's internals don't handle
FontProperties.get_fname returning a Path).
Useful if you want to play with mplcairo wrt. #14939 (#14939 (comment)).
PR Summary
PR Checklist