Someone in the OpenSUSE Chinese forum asked his input method played "charming" "flatter" the word why display as "female"+"yuan". Doubt is the problem of fonts, so when idle with friends write Python-fontconfig with Pillow (PIL a fork) wrote a script, using all the system contains the "flatter" word to display the word, to see exactly which fonts have a problem.
The (updated) script is as follows:
Google Chrome/chromium Users Note: If the copied code contains nonbreaking spaces (0xa0), please replace them manually.
#!/usr/bin/env Python3
# Vim:fileencoding=utf-8
From PIL import Image, Imagedraw, Imagefont
Import Fontconfig
ch = ' Flatter '
Def get_fonts ():
RET = []
For f in Fontconfig.query ():
f = fontconfig. Fcfont (f)
If F.has_char (CH):
Ret.append ((F.file, F.bestname))
return ret
W, h = 800, 20000
Image = Image.new (' RGB ', (w, h), ' white ')
Draw = Imagedraw.draw (image)
pos = 0
w = 0
STRs = Ch
For Fontfile, FontName in Get_fonts ():
Font = Imagefont.truetype (Fontfile, 24)
s = '%s:%s '% (FontName, STRs)
Font_width, Font_height = Font.getsize (s)
W = Max ((font_width, W))
Draw.text ((POS), S, Font=font, fill= ' black ')
pos + = Font_height
H = pos
Image = Image.crop ((0, 0, w+10, h))
Image.Save (' Fonts.png ')
Look for the font and render it to the Fonts.png file in the current directory. The process of looking for fonts takes time and waits patiently. The final results are as follows:
I am here, Wen Quan Shu, founder Weibei ref, some Droid Sans Fallback font "flatter" character in the wrong shape. (I have three font files called "droid Sans fallback" ... ) >