Include kerning when outputting pdf strings.#18517
Conversation
| from .ft2font import KERNING_DEFAULT, LOAD_NO_HINTING | ||
|
|
||
|
|
||
| LayoutItem = dataclasses.make_dataclass( |
There was a problem hiding this comment.
What are dataclasses getting us here that a named tuple would not?
There was a problem hiding this comment.
The thing is not iterable, which avoids accidentally relying on an unpacking API (x, y = ...) which would be a pain to modify (i.e. you can't add another field while maintaining a sensible deprecation).
Of course this is private API so in a sense we could do whatever we want, but as a general rule I think dataclasses are nicer (but note that I went for the "functional" declaration API because I certainly wouldn't want to be the person introducing type hints in the codebase :))
There was a problem hiding this comment.
That is a compelling agreement 👍 .
|
I believe making selection across non-latin1 characters work would be a huge amount of work, indeed. |
PR Summary
Closes #18282.
PR Checklist
pytestpasses).flake8on changed files to check).flake8-docstringsandpydocstyle<4and runflake8 --docstring-convention=all).doc/users/next_whats_new/(follow instructions in README.rst there).doc/api/next_api_changes/(follow instructions in README.rst there).