I am developing an embedded system with a local display and multilingual support. Now I am wondering if my font contain all the glyphs the system need.
Of coz, we always google it first, but...

 

Method 1 (Qt)

http://stackoverflow.com/questions/2681405/how-to-detect-missing-font-characters

https://bugreports.qt-project.org/browse/QTBUG-1732

 

Yes, the Qt have a bug (actually, it isn’t a bug, but user misunderstand the document), so we can’t do it easier with Qt.

 

Method 2 (GDI – GetGlyphIndices())

http://msdn.microsoft.com/en-us/library/windows/desktop/dd144890(v=vs.85).aspx

But I think it is too complex, the DC is surplus in my case, I just want to focus on font!

 

Method 3 (FreeType library)

Finally, I decide to use python + freetype library to solve my problem. With this script, you can input a TTF file and a text file(UTF-8), and than it will report you what character in the text file is missing with this TTF font.

 

Source Code:

https://github.com/diro/pyGlyphChecker

 

Thanks for the freetype-py library XD

https://code.google.com/p/freetype-py/

創作者介紹
創作者 diro 的頭像
diro

Diro - 探索生活中的美好事物

diro 發表在 痞客邦 留言(0) 人氣()