When rendering text using PIL (ImageFont, ImageDraw, etc.) if the font is missing a glyph for a particular character, it just skips that character. I don't see any mechanism in the docs for specifying a fallback font. Is there a tried-and-true recipe for using a fallback font for missing glyphs in PIL?
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
I couldn't figure out how to do this, but I did find a workaround. I used FontForge to fill in the missing glyphs in the main font, with backup glyphs from another font. As explained in this answer: https://superuser.com/questions/490922/merging-two-font-into-one
The only catch was that I'm running OS X 10.11.3, and the current stable release of FontForge just dies on that O/S. So I had to build FontForge from source. I did that following the "homebrew" instructions on this page: https://github.com/fontforge/fontforge/blob/master/INSTALL-git.md