问题
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?
回答1:
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
来源:https://stackoverflow.com/questions/35436932/is-there-a-way-to-fallback-for-missing-glyphs-with-pil