Skip to content
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

Added ability to set language for text rendering #3693

Merged
merged 12 commits into from Mar 12, 2019
Merged

Added ability to set language for text rendering #3693

merged 12 commits into from Mar 12, 2019

Conversation

iwsfutcmd
Copy link
Contributor

Changes proposed in this pull request:

  • Add language parameter to all text rendering methods

libraqm allows a language to be specified when formatting text, to indicate to the font that language-specific glyphs and ligatures are required. Pillow previously had no way to access this functionality, this pull request allows for it by implementing libraqm's raqm_set_language() function. Note that with raqm_set_language(), different chunks of the text string can be specified as different languages, but I wrote this to set the entire string as a single language as it would be difficult to implement in a non-confusing fashion to users and seemed unnecessary as if multiple languages are needed, the user can draw text multiple times.

I've included tests and documentation as well.

docs/reference/ImageDraw.rst Outdated Show resolved Hide resolved
docs/reference/ImageDraw.rst Outdated Show resolved Hide resolved
docs/reference/ImageDraw.rst Outdated Show resolved Hide resolved
@radarhere radarhere changed the title added ability to set language for text rendering Added ability to set language for text rendering Mar 7, 2019
Copy link
Member

@hugovk hugovk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@iwsfutcmd
Copy link
Contributor Author

Please could you add this to the release notes?

* https://github.com/python-pillow/Pillow/blob/master/docs/releasenotes/6.0.0.rst

Done! Also noticed that I forgot to implement the language parameter on the multiline text functions, this is now fixed, including documentation.

Also, the AppVeyor CI check seems to randomly fail sometimes for reasons outside of the control of anybody making a pull request (trouble connecting to a server to fetch requirements, etc.) Is there any way to retry such checks without making a new commit?

And some minor editing to make more concise/consistent.
@hugovk
Copy link
Member

hugovk commented Mar 12, 2019

Also, the AppVeyor CI check seems to randomly fail sometimes for reasons outside of the control of anybody making a pull request (trouble connecting to a server to fetch requirements, etc.) Is there any way to retry such checks without making a new commit?

I've clicked to rebuild and created #3710 to improve build robustness.

Thanks, all green now, merging!

@hugovk hugovk merged commit e2fda90 into python-pillow:master Mar 12, 2019
@iwsfutcmd
Copy link
Contributor Author

Thanks a bunch for all your support! And this was my first approved pull request!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants