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

Implement anchor for TrueType fonts #4930

Merged
merged 8 commits into from Oct 5, 2020
Merged

Conversation

nulano
Copy link
Contributor

@nulano nulano commented Sep 22, 2020

Second part of #4724, implementing anchor parameter to fix #4511.

Changes proposed in this pull request:

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.

f-strings!

Tests/test_imagefont.py Outdated Show resolved Hide resolved
Tests/test_imagefont.py Outdated Show resolved Hide resolved
Tests/test_imagefontctl.py Outdated Show resolved Hide resolved
Tests/test_imagefontctl.py Outdated Show resolved Hide resolved
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
docs/handbook/text-anchors.rst Outdated Show resolved Hide resolved
docs/handbook/text-anchors.rst Outdated Show resolved Hide resolved
Horizontal anchor alignment
^^^^^^^^^^^^^^^^^^^^^^^^^^^

``l`` --- left
Copy link
Member

Choose a reason for hiding this comment

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

Nit: and for these triple dashes?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

  1. A colon or shorter dash made the description too close and a little harder to read.
  2. According to most style guides, the em-dash is an alternative to the colon, see https://en.wikipedia.org/wiki/Dash#Usage_2

(side note: -- is an en-dash and --- is an em-dash with Sphinx by default: https://www.sphinx-doc.org/en/master/usage/configuration.html?highlight=em-dash#confval-smartquotes_action)

docs/handbook/text-anchors.rst Show resolved Hide resolved
nulano and others added 2 commits October 4, 2020 20:12
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Comment on lines +378 to +379
if direction == "ttb":
raise ValueError("ttb direction is unsupported for multiline text")
Copy link
Contributor Author

@nulano nulano Oct 4, 2020

Choose a reason for hiding this comment

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

Forgot to mention: I didn't implement anchor handling for vertical multiline text due to #4945, so instead this raises an error to avoid confusion due to unexpected anchor values.

@hugovk hugovk merged commit b29cab0 into python-pillow:master Oct 5, 2020
@nulano nulano deleted the anchor-part2 branch October 14, 2020 19:01
@nulano nulano mentioned this pull request Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Vertical text alignment ignores yOffset RTL Direction not having any effect
2 participants