-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
32-bit Unicode code points don't work on Windows #3777
Labels
Comments
nulano
added a commit
to nulano/Pillow
that referenced
this issue
Apr 8, 2019
nulano
added a commit
to nulano/Pillow
that referenced
this issue
Apr 8, 2019
nulano
added a commit
to nulano/Pillow
that referenced
this issue
Apr 8, 2019
nulano
added a commit
to nulano/Pillow
that referenced
this issue
Apr 8, 2019
This is also a duplicate of #3344 . |
radarhere
pushed a commit
to nulano/Pillow
that referenced
this issue
Jun 25, 2019
#3780 has been merged, which fixes this issue for Python 3. This can either be closed now, or after Pillow 6.2.0, when Python 2 support is no longer needed. |
This report was for Python 3, let's close it. Thanks all! |
This was referenced Jul 1, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When rendering with TrueType fonts on Windows, Unicode code points outside the 16-bit range are rendered as a pair of unknown characters (usually a box with a question mark). I suspect this is caused by one of the following lines:
Pillow/src/_imagingft.c
Line 322 in 36db534
Pillow/src/_imagingft.c
Line 363 in 36db534
According to Python docs,
Py_UNICODE
is a typedef forwchar_t
, which is 16-bit on Windows, but typically 32-bit on Linux. The docs suggest using the typePy_UCS4
and functionPyUnicode_AsUCS4Copy
(introduced in Python 3.3).https://docs.python.org/3/c-api/unicode.html#c.PyUnicode_AsUCS4Copy
I would attempt changing this myself, but I'm not sure how to compile native Python libraries from source.
Code to reproduce:
Font used: https://www.fontspace.com/unicode-fonts-for-ancient-scripts/symbola
Result on Windows (Pillow 5.4.1, Python 3.7.0 32-bit, Windows 7 64-bit):
Result on Linux (Pillow 5.4.1, Python 3.4.3, Linux Mint 17.3 64-bit):
The text was updated successfully, but these errors were encountered: