You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Incorrect behavior of text=str.upper() in ImageDraw.Draw.text #5993
changed the title [-]incorrect behavior of `text=str.upper()` in ImageDraw.Draw.text[/-][+]Incorrect behavior of `text=str.upper()` in ImageDraw.Draw.text[/+]on Jan 27, 2022
original string
ქ 4325 is in font
ა 4304 is in font
რ 4320 is in font
თ 4311 is in font
უ 4323 is in font
ლ 4314 is in font
ი 4312 is in font
uppercase string
Ქ 7333 is missing from font
Ა 7312 is missing from font
Რ 7328 is missing from font
Თ 7319 is missing from font
Უ 7331 is missing from font
Ლ 7322 is missing from font
Ი 7320 is missing from font
Activity
[-]incorrect behavior of `text=str.upper()` in ImageDraw.Draw.text[/-][+]Incorrect behavior of `text=str.upper()` in ImageDraw.Draw.text[/+]radarhere commentedon Jan 27, 2022
Hi. What font are you using?
chiboreache commentedon Jan 27, 2022
I found similar behaviour in many fonts Code2000, DejaVuSans, DejaVuSerif, FreeSerif, FreeMonoBold ...
radarhere commentedon Jan 27, 2022
As with #5948, it is important to understand that fonts do not automatically support every character you might try.
Starting with code from https://stackoverflow.com/questions/4458696/finding-out-what-characters-a-given-font-supports and making changes, here is code (using fonttools rather than Pillow) that checks if the characters you are trying to draw are supported by the font.
Running the code, I get
So I conclude that the font is missing the 'upper' version of your characters.
For example, https://www.compart.com/en/unicode/U+10E5 is supported by Code2000, but https://www.compart.com/en/unicode/U+1CA5 is not.
chiboreache commentedon Jan 27, 2022
it would be nice to have built in char checker, but whatever, thank you @radarhere !