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

ENH: try to use unicode charmap before ADOBE_STANDARD in textpath#8286

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

Closed

Conversation

tacaswell
Copy link
Member

This will allow a wider range of glyphs to be exported.

Closes#8280

This needs some tests and an understanding of why the adobe mapping was used to begin with.

This will allow a wider range of glyphs to be exported.Closesmatplotlib#8280
@tacaswelltacaswell added this to the2.1 (next point release) milestoneMar 13, 2017
@tacaswelltacaswell modified the milestones:2.1.1 (next bug fix release),2.1 (next point release)Aug 13, 2017
@tacaswelltacaswell modified the milestones:2.1.1 (next bug fix release),2.2 (next feature release)Oct 9, 2017
Copy link
Contributor

@anntzeranntzer left a comment

Choose a reason for hiding this comment

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

While working on improving usetex support in mplcairo, I realized why this won't work (at least as is).

In usetex mode, the SVG backend gets a list of (fontpath, glyph-index) from dviread and passes them to textpath to generate the glyph outlines that get embedded into the SVG file. However, the indices in the dvi file (and thus returned by dviread) correspond to the "native" charmap in the font file, which, for pfb fonts (e.g. computer modern), is an Adobe mapping. The Unicode charmaps are actually "fake" charmaps synthesized on-the-fly by FreeType. In particular, they do not include ligatures (which after all do not correspond to Unicode codepoints).
For example, one can trytext(.5, .5, "ff", usetex=True); savefig("/tmp/test.svg") ("ff" is a ligature at position 11 of the "native" charmap); with this PR one gets

/home/antony/src/extern/matplotlib/lib/matplotlib/textpath.py:391: RuntimeWarning: Glyph 11 missing from current font.  glyph0 = font.load_char(charcode, flags=ft2font_flag)

and theff ligature is not included (because, with the PR, one tries instead to load the character at Unicode codepoint 11, which is not a printable character).

@tacaswell
Copy link
MemberAuthor

@anntzer Is this salvageable? If you think not feel free to close.

@anntzer
Copy link
Contributor

Let's keep this open while I figure out whether#8415 works better.

@anntzeranntzer mentioned this pull requestDec 3, 2018
6 tasks
@anntzer
Copy link
Contributor

I think this has been superseded by#12928 (which owes much to this PR, thanks :)).

@anntzeranntzer closed thisJul 5, 2019
@tacaswelltacaswell deleted the fix_textpath_unicode branchJuly 5, 2019 22:39
@tacaswell
Copy link
MemberAuthor

"Programming by doing it badly and annoying someone else enough to do it right" ;)

@anntzer
Copy link
Contributor

anntzer commentedJul 5, 2019
edited
Loading

I'm very easily annoyable... :)

@story645story645 removed this from thefuture releases milestoneOct 6, 2022
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer requested changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Trouble saving svg file when plot contains special characters
3 participants
@tacaswell@anntzer@story645

[8]ページ先頭

©2009-2025 Movatter.jp