Someone in OpenSUSE Chinese forum asked his input method to play the "charming" "妩" the word Why Show as "female"+"yuan." Doubt is the font of the problem, so idle with a friend to write the python-fontconfig with Pillow (PiL of a fork) wrote a script, using the system all contain this "妩" word font to display the word, to see exactly which fonts have problems.
The (updated) script is as follows:
Google Chrome/chromium Users Please note: If the copied code contains nonbreaking spaces (0xa0), please manually replace.
#!/usr/bin/env Python3
# Vim:fileencoding=utf-8
From PIL import Image, Imagedraw, Imagefont
Import Fontconfig
ch = ' 妩 '
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 fonts and render them to the Fonts.png file in the current directory. The process of looking for a font takes time and waits patiently. The final results are as follows:
Here I am, Wen Quan Shu, founder Weibei ref, some Droid Sans fallback font "妩" is not in the wrong shape. (I have three font files here called "droid Sans fallback" ...). ) >