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

Fix loading of Type1 "native" charmap.#29843

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

Merged
QuLogic merged 1 commit intomatplotlib:mainfromanntzer:t1ev
Apr 15, 2025
Merged

Conversation

anntzer
Copy link
Contributor

Type1 fonts have a "native" charmap (mapping of indices to glyphs (*)), which is simply the order in which glyphs are physically listed in the file (see section 2.2 of Type1 reference linked below); this charmap needed when decoding dvi files for usetex mode (as dvi represent glyphs with these indices). Usually, this charmap is tagged as "ADOBE_STANDARD" or "ADOBE_CUSTOM", which is the heuristic we previously used to load it, but it is unclear to me whether this is guaranteed (reference section 10.3), and FreeType may supply its own reencodings (it already does so to try to provide a unicode charmap). Instead, directly read and return the encoding vector via FreeType's Type1-specific API. (The choice to return an mapping of Type1 indices to FreeType-internal indices, rather than Type1 indices to glyph names, is motivated by upcoming changes for {xe,lua}tex support, which also use FreeType-internal indices.)

Type1 reference:
https://adobe-type-tools.github.io/font-tech-notes/pdfs/T1_SPEC.pdf

(*) Not all glyphs correspond to a unicode codepoint (e.g. a font can contain arbitrary ligatures that are not representable in unicode), which is (one of the reasons) why fonts provide their own indexing methods.

(This is tested by the same test as#12928.)

PR summary

PR checklist

Type1 fonts have a "native" charmap (mapping of indices to glyphs(\*)), which is simply the order in which glyphs are physically listedin the file (see section 2.2 of Type1 reference linked below); thischarmap needed when decoding dvi files for usetex mode (as dvi representglyphs with these indices).  Usually, this charmap is tagged as"ADOBE_STANDARD" or "ADOBE_CUSTOM", which is the heuristic we previouslyused to load it, but it is unclear to me whether this is guaranteed(reference section 10.3), and FreeType may supply its own reencodings(it already does so to try to provide a unicode charmap).  Instead,directly read and return the encoding vector via FreeType'sType1-specific API.  (The choice to return an mapping of Type1 indicesto FreeType-internal indices, rather than Type1 indices to glyph names,is motivated by upcoming changes for {xe,lua}tex support, which also useFreeType-internal indices.)Type1 reference:https://adobe-type-tools.github.io/font-tech-notes/pdfs/T1_SPEC.pdf(\*) Not all glyphs correspond to a unicode codepoint (e.g. a font cancontain arbitrary ligatures that are not representable in unicode),which is (one of the reasons) why fonts provide their own indexingmethods.
@QuLogicQuLogic merged commitb7e7663 intomatplotlib:mainApr 15, 2025
42 checks passed
@anntzeranntzer deleted the t1ev branchApril 15, 2025 06:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@QuLogicQuLogicQuLogic approved these changes

@timhoffmtimhoffmtimhoffm approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
v3.11.0
Development

Successfully merging this pull request may close these issues.

3 participants
@anntzer@QuLogic@timhoffm

[8]ページ先頭

©2009-2025 Movatter.jp