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

Support scale in ttf composite glyphs#18081

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
jkseppan wants to merge7 commits intomatplotlib:masterfromjkseppan:ttconv-scale

Conversation

jkseppan
Copy link
Member

@jkseppanjkseppan commentedJul 27, 2020
edited
Loading

Fixes#17197

I added a test using Free Serif, which has plenty of composite characters such as arrows drawn by rotating other arrows.

PR Summary

PR Checklist

  • Has Pytest style unit tests
  • Code isFlake 8 compliant
  • New features are documented, with examples if plot related
  • Documentation is sphinx and numpydoc compliant
  • Added an entry to doc/users/next_whats_new/ if major new feature (follow instructions in README.rst there)
  • Documented in doc/api/next_api_changes/* if API changed in a backward-incompatible way

@jkseppanjkseppan marked this pull request as ready for reviewJuly 27, 2020 13:36
@jkseppan
Copy link
MemberAuthor

Interestingly, the test reveals that the Agg backend doesn't handle the font quite right.
ttconv_transforms

@jkseppan
Copy link
MemberAuthor

Correct output, screenshot from a PDF viewer.

png

@jkseppanjkseppanforce-pushed thettconv-scale branch 2 times, most recently frome1d4421 to8293741CompareJuly 27, 2020 16:08
@anntzer
Copy link
Contributor

I'll trust you on the ttf parsing, but otherwise the patch looks reasonable.

@jkseppanjkseppan deleted the ttconv-scale branchJuly 27, 2020 16:47
@jkseppanjkseppan restored the ttconv-scale branchJuly 27, 2020 16:47
@jkseppan
Copy link
MemberAuthor

Oops, made a typo with a push and accidentally closed this.

@jkseppanjkseppan reopened thisJul 27, 2020
@jkseppan
Copy link
MemberAuthor

If someone wants to check the code against documentation, composite glyphs are described athttps://docs.microsoft.com/en-us/typography/opentype/spec/glyf#composite-glyph-description and 2.14 fixed-point format athttps://docs.microsoft.com/en-us/typography/opentype/otspec181/otff#data-types (search for F2DOT14).

@jkseppanjkseppan requested a review fromanntzerJuly 29, 2020 11:25
anntzer
anntzer previously approved these changesJul 29, 2020
@QuLogic
Copy link
Member

Interestingly, the test reveals that the Agg backend doesn't handle the font quite right.

If I run outside the test framework, it appears to be okay?

@jkseppan
Copy link
MemberAuthor

Interestingly, the test reveals that the Agg backend doesn't handle the font quite right.

If I run outside the test framework, it appears to be okay?

Yes, I couldn't reproduce this. It might have been some problem with an intermediate version, as I might have forgotten to compile the extension when running some test.

@QuLogic
Copy link
Member

QuLogic commentedAug 1, 2020
edited
Loading

Interestingly, the test reveals that the Agg backend doesn't handle the font quite right.

If I run outside the test framework, it appears to be okay?

Yes, I couldn't reproduce this. It might have been some problem with an intermediate version, as I might have forgotten to compile the extension when running some test.

To clarify, Ican reproduce if running in the test suite, by removing the explicit extension from the comparison settings.

This is because tests disable hinting withplt.rcParams['text.hinting'] = 'none'; if you run the script outside the test suite, but add that, then you get the weird streaks. Any setting other than'force_autohint' or'auto' (same thing to FreeType, latter is what we call our default) will do it, so it seems to be something wrong in the font hinting itself.

jkseppan reacted with thumbs up emoji

@jkseppan
Copy link
MemberAuthor

The test failures are because of unrelated Pandas deprecations; apparently Pandas 1.1.0 is now available

@QuLogic
Copy link
Member

This is already fixed on master; you should rebase if you're having trouble with it.

The GNU Free Serif font has a wide variety of characters with whichwe can exercise the linear transforms used in TTF composite glyphs.
These could increase the file length in case of fonts withmany composite glyphs.
@QuLogic
Copy link
Member

It looks like you may have accidentally reverted some things in that last rebase?

@QuLogicQuLogic added this to thev3.4.0 milestoneAug 4, 2020
jkseppanand others added2 commitsAugust 5, 2020 09:44
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
Co-authored-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
@jkseppan
Copy link
MemberAuthor

It looks like you may have accidentally reverted some things in that last rebase?

You're right, it looks like I lost the suggestions committed via the Github web UI. I committed those again.

@anntzer
Copy link
Contributor

See#18181 for an alternate solution, though (which can reasonably avoid adding a new font file in the repo, and in any case seems more robust in the long term, as it can Type3-subset any font that FreeType can outline-decompose).

jkseppan reacted with thumbs up emoji

@anntzeranntzer dismissed theirstale reviewAugust 5, 2020 10:24

Still approving, but perhaps make a decision wrt#18181 first.

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@anntzeranntzeranntzer left review comments

@QuLogicQuLogicAwaiting requested review from QuLogic

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

Successfully merging this pull request may close these issues.

Missing character upon savefig() with Free Serif font
3 participants
@jkseppan@anntzer@QuLogic

[8]ページ先頭

©2009-2025 Movatter.jp