-
Notifications
You must be signed in to change notification settings - Fork 6k
[CanvasKit] Automatically fall back to Noto fonts #23096
[CanvasKit] Automatically fall back to Noto fonts #23096
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat. Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
I am uploading this WIP PR for review since it's pretty big @yjbanov. I am working on fixing the relayout issue currently. |
Fixed the issue of not updating the paragraphs when the new fonts are loaded. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some preliminary nitpicks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM modulo comments (which are non-blocking as long as there are no significant correctness and performance regressions). This needs tests, ideally with screenshots. Probably integration test is not necessary; a unit-test should be able to do the job. The PR adds a lot of non-trivial code paths to the paragraph construction, particular character-by-character look-ups. Let's make sure this does not regress performance. We should have some benchmarks that capture this, but perhaps we could add more (e.g. a microbenchmark that measures pure paragraph construction, without layout/rendering).
Leaving to you and @ferhatb to finish up.
)" This reverts commit eff27c7. Reason for revert: Incorrect logic breaks Gallery
)" (flutter#23357) This reverts commit eff27c7. Reason for revert: Incorrect logic breaks Gallery
)" (flutter#23357) This reverts commit eff27c7. Reason for revert: Incorrect logic breaks Gallery
…utter#23096)" (flutter#23357)" This reverts commit f9f4d01.
…23728) * Revert "Revert "[CanvasKit] Automatically fall back to Noto fonts (#23096)" (#23357)" This reverts commit f9f4d01. * WIP * Use an Interval Tree to store the unicode ranges for the Noto Fonts * Update licenses * Remove debug print statements * Respond to comments * Fix analysis error * Add tests * Respond to comments * Fix test * Update goldens lock * Skip screenshot test on Safari * Skip CanvasKit tests on iOS Safari * Move CanvasKit initialization so it doesn't run on iOS Safari
…lutter#23728) * Revert "Revert "[CanvasKit] Automatically fall back to Noto fonts (flutter#23096)" (flutter#23357)" This reverts commit f9f4d01. * WIP * Use an Interval Tree to store the unicode ranges for the Noto Fonts * Update licenses * Remove debug print statements * Respond to comments * Fix analysis error * Add tests * Respond to comments * Fix test * Update goldens lock * Skip screenshot test on Safari * Skip CanvasKit tests on iOS Safari * Move CanvasKit initialization so it doesn't run on iOS Safari
Description
Checks if the given fonts can display all of the code units in a string, and if not, tries to download the fonts from Google Fonts which have glyphs for the missing code units.
Related Issues
Fixes flutter/flutter#53897
Fixes flutter/flutter#58496
Fixes flutter/flutter#58506
Tests
I will add tests in a follow-up PR. TODO create issue to add tests
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.Reviewer Checklist
Breaking Change
Did any tests fail when you ran them? Please read handling breaking changes.