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

Improve fallback font export tests#28784

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
tacaswell merged 3 commits intomatplotlib:mainfromQuLogic:better-fallback-tests
Jan 31, 2025

Conversation

QuLogic
Copy link
Member

@QuLogicQuLogic commentedSep 6, 2024
edited
Loading

PR summary

Working on#28765, I realized that we don't need an external font to test font fallback, ascmr10, and related, fonts have fairly low coverage compared toDejaVu Sans. Thus font fallback can easily be tested by starting withcmr10, and pulling additional characters fromDejaVu Sans.

In addition, this change increases unique characters in the figure to 491, which triggers some code paths for tables that are normally limited to 256 characters.

The latter may be a bit overkill, but it shows that EPS is broken for a large set of unique characters, at least when viewed with evince. In that case, about half the bottom set of accented characters is missing, without any warnings produce. I have not yet determined the cause of this problem, but it looks like both type 3 and 42 use thettconv extension to subset, though for large character sets, type 3 is forced to 42.

It is possible that#20866 might be helpful here, but it would also be helpful if someone could confirm with a different EPS viewer.

PR checklist

@QuLogic
Copy link
MemberAuthor

FWIW,#20866 does appear to fix the EPS result.

@QuLogic
Copy link
MemberAuthor

Comparing in evince, the type 3 PDF glyphs are slightly cropped at the bottom vs the type42 file. But when@ksunden checked on macOS Preview, the whole glyphs changed thickness somewhat, so I'm going to chalk this up to renderer differences right now.

@QuLogic
Copy link
MemberAuthor

I modified a couple other tests to use the same fonts/text, and removed a couple tests that seem to duplicate the others.

@ksunden
Copy link
Member

Are we missing the CJK font checks now with the new test string? (It has a lot of accented characters, but not as many characters that require specific fonts)

If the goal of the test is purely to test if fallback works, I gues this is probably enough, but do we also need to test the specific fallback for CJK characters? Because that feels like a specific usecase that is representative of real world usage.

@QuLogic
Copy link
MemberAuthor

We are still checking Noto Sans CJK and WenQuanYi intest_font_manager.py.

I don't think CJK characters are sufficiently different from semi-Latin script (unlike e.g., Devanagari, etc.) in these cases.

@QuLogicQuLogicforce-pushed thebetter-fallback-tests branch 2 times, most recently from6844ee8 to47fb508CompareDecember 18, 2024 01:00
Working onmatplotlib#28765, I realized that we don't need an external font totest font fallback, as `cmr10`, and related, fonts have fairly lowcoverage compared to `DejaVu Sans`. Thus font fallback can easily betested by starting with `cmr10`, and pulling additional characters from`DejaVu Sans`.In addition, this change increases unique characters in the figure to491, which triggers some code paths for tables that are normally limitedto 256 characters.
- matplotlib.tests.test_backend_pdf::test_embed_fonts is the same as  `test_multi_font_type3` and `test_multi_font_type42`- matplotlib.tests.test_ft2font::test_font_fallback_chinese is the same  as `test_fallback_smoke` except with Chinese fonts.
@tacaswelltacaswell merged commit7285029 intomatplotlib:mainJan 31, 2025
39 checks passed
@tacaswelltacaswell added this to thev3.11.0 milestoneJan 31, 2025
@QuLogicQuLogic deleted the better-fallback-tests branchJanuary 31, 2025 22:41
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@timhoffmtimhoffmtimhoffm approved these changes

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

Successfully merging this pull request may close these issues.

4 participants
@QuLogic@ksunden@timhoffm@tacaswell

[8]ページ先頭

©2009-2025 Movatter.jp