Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use glyph indices for font tracking in vector formats#30335

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
QuLogic wants to merge3 commits intomatplotlib:text-overhaul
base:text-overhaul
Choose a base branch
Loading
fromQuLogic:vector-glyphs

Conversation

QuLogic
Copy link
Member

PR summary

With libraqm, string layout produces glyph indices, not character codes, and font features may even produce different glyphs for the same character code (e.g., by picking a different Stylistic Set). Thus we cannot rely on character codes as unique items within a font, and must move toward glyph indices everywhere.

The only thing I don't quite like is that PDF uses character codes for its lookup, and I have to map glyph indices back through an inverse charmap. I think I may have to send everything throughCharacterTracker and produce my own limited charmap, but still need to test out what's required.

This is based on#30143.

PR checklist

Previously, these were both typed as `int`, which means you could mixand match them erroneously. While the character code can't be made adistinct type (because it's used for `chr`/`ord`), typing glyph indicesas a distinct type means these can't be fully swapped.Unfortunately, you can still go back to the base type, so glyph indicesstill work as character codes. But this is still sufficient to catcherrors such as the wrong call to `FT2Font.get_kerning` in`_mathtext.py`.
The `FontInfo.num` value returned by `TruetypeFonts._get_info` is acharacter code, but `FT2Font.get_kerning` takes *glyph indices*, meaningthat kerning was likely off in most cases.
With libraqm, string layout produces glyph indices, not character codes,and font features may even produce different glyphs for the samecharacter code (e.g., by picking a different Stylistic Set). Thus wecannot rely on character codes as unique items within a font, and mustmove toward glyph indices everywhere.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Projects
Status: Waiting for other PR
Milestone
v3.11.0
Development

Successfully merging this pull request may close these issues.

1 participant
@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp