Is there a way to fallback for missing glyphs with

2019-07-09 03:57发布

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条回答
够拽才男人
2楼-- · 2019-07-09 04:42

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

查看更多
登录 后发表回答