Skip to content

[web] Fall back to full CJK fonts for characters not covered by split slices#188890

Merged
auto-submit[bot] merged 7 commits into
flutter:masterfrom
harryterkelsen:web-cjk-font-fallback
Jul 13, 2026
Merged

[web] Fall back to full CJK fonts for characters not covered by split slices#188890
auto-submit[bot] merged 7 commits into
flutter:masterfrom
harryterkelsen:web-cjk-font-fallback

Conversation

@harryterkelsen

@harryterkelsen harryterkelsen commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Allows the web engine to download and use the full CJK fallback fonts when encountering rare characters (such as archaic Jamo) that are not included in the smaller, split CJK font slices.

Fixes #188255

Pre-launch Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

If this change needs to override an active code freeze, provide a comment explaining why. The code freeze workflow can be overridden by code reviewers. See pinned issues for any active code freezes with guidance.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

… slices

Allows the web engine to download and use the full CJK fallback fonts when encountering rare characters (such as archaic Jamo) that are not included in the smaller, split CJK font slices.
@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Jul 1, 2026
@github-actions github-actions Bot added engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team labels Jul 1, 2026

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Code Review

This pull request introduces support for split-slice fallback fonts (such as CJK fonts) to optimize font downloads by preferring smaller slices over monolithic parent fonts unless required. It updates the font rolling script to decompress .woff2 files, compute exclusive character sets, and serialize parent-slice relationships, while updating the fallback service to manage registration and pending states across slices and parents. Feedback suggests using path.setExtension instead of replaceAll in the font rolling script to safely change file extensions.

Comment thread engine/src/flutter/lib/web_ui/dev/roll_fallback_fonts.dart Outdated
@harryterkelsen
harryterkelsen requested a review from flutter-zl July 7, 2026 19:47
@flutter-dashboard

Copy link
Copy Markdown

Golden file changes have been found for this pull request. Click here to view and triage (e.g. because this is an intentional change).

If you are still iterating on this change and are not ready to resolve the images on the Flutter Gold dashboard, consider marking this PR as a draft pull request above. You will still be able to view image results on the dashboard, commenting will be silenced, and the check will not try to resolve itself until marked ready for review.

For more guidance, visit Writing a golden file test for package:flutter.

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing.

Changes reported for pull request #188890 at sha d460467

@flutter-dashboard flutter-dashboard Bot added the will affect goldens Changes to golden files label Jul 8, 2026

@flutter-zl flutter-zl left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The approach looks good overall, but I left a couple of test coverage comments that I think should be addressed before landing.

Comment thread engine/src/flutter/lib/web_ui/test/engine/font_fallback_service_test.dart Outdated

// 0x1100 is combining Jamo (triggers monolithic Noto Sans KR)
// 0x4E00 is standard CJK (triggers Noto Sans KR split slice, e.g., Noto Sans KR 0)
FallbackFontService.instance.addMissingCodePoints(<int>[0x1100, 0x4E00]);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could you add a reverse-order test for the same-batch parent plus slice case? The current [0x1100, 0x4E00] order covers rare-character-first. Adding [0x4E00, 0x1100], ideally with debugUserPreferredLanguage = 'ko', would cover the case where the split slice is inserted before the full parent candidate.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch! This actually uncovered a problem with the original implementation where the order of the codepoints could change which fonts get downloaded. I fixed it so that we will never download a parent font and one of the split fonts in the same batch

@harryterkelsen
harryterkelsen requested a review from flutter-zl July 9, 2026 23:04
@harryterkelsen
harryterkelsen force-pushed the web-cjk-font-fallback branch from aab4bbd to 0233a9f Compare July 9, 2026 23:10
flutter-zl
flutter-zl previously approved these changes Jul 10, 2026
@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 10, 2026
@auto-submit auto-submit Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 10, 2026
@auto-submit

auto-submit Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

autosubmit label was removed for flutter/flutter/188890, because - The status or check suite Linux linux_unopt has failed. Please fix the issues identified (or deflake) before re-applying this label.

@harryterkelsen harryterkelsen added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 13, 2026
@auto-submit
auto-submit Bot added this pull request to the merge queue Jul 13, 2026
Merged via the queue into flutter:master with commit 0cf5a62 Jul 13, 2026
202 checks passed
@flutter-dashboard flutter-dashboard Bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Jul 13, 2026
auto-submit Bot pushed a commit to flutter/packages that referenced this pull request Jul 14, 2026
flutter/flutter@cf9e8af...846664b

2026-07-14 [email protected] Roll Skia from dfcff99566c3 to 88954ef8f36d (1 revision) (flutter/flutter#189440)
2026-07-14 [email protected] refactor: remove material import from scrollable_semantics_test and selectable_region_context_menu_test (flutter/flutter#186611)
2026-07-14 [email protected] Roll Skia from 3d1fc554f1a2 to dfcff99566c3 (17 revisions) (flutter/flutter#189428)
2026-07-14 [email protected] Roll Dart SDK from 2c587df8f05a to 05bf153370c4 (5 revisions) (flutter/flutter#189426)
2026-07-14 [email protected] [flutter_tools] Remove web hot reload flag (flutter/flutter#185994)
2026-07-14 [email protected] [iOS] Fix flaky keyboard animation test (flutter/flutter#189353)
2026-07-14 [email protected] [Impeller] Playground expanded role (flutter/flutter#188889)
2026-07-14 [email protected] Roll pub packages (flutter/flutter#189409)
2026-07-13 [email protected] Update lock-threads dependency to 6.0.2 (flutter/flutter#189053)
2026-07-13 49699333+dependabot[bot]@users.noreply.github.com Bump actions/labeler from 6.1.0 to 6.2.0 in the all-github-actions group (flutter/flutter#189396)
2026-07-13 [email protected] Remove  outdated todo about `analysis bug on Windows` and update condition to also perform `analysis on windows` (flutter/flutter#189283)
2026-07-13 [email protected] Add more 0x0 size tests part 4 (flutter/flutter#185187)
2026-07-13 [email protected] Roll Packages from 20928d5 to ad2eab1 (18 revisions) (flutter/flutter#189387)
2026-07-13 [email protected] [flutter_tools] Fix ADB device listing output parsing regression (flutter/flutter#189369)
2026-07-13 [email protected] Stop running most Mac x64 builders that have Mac ARM equivalents on master (flutter/flutter#189301)
2026-07-13 [email protected] Move a few benchmarks from x64 Intel Macs to ARM (flutter/flutter#189377)
2026-07-13 [email protected] Add note that `hcpp` needs impeller (flutter/flutter#189382)
2026-07-13 [email protected] Roll Fuchsia Linux SDK from vhIlDkWIy21IrlB9E... to oOETA0ISPouDt2xBo... (flutter/flutter#189349)
2026-07-13 [email protected] [flutter_tools] Respect mustMatchAppBuild on Windows native assets (flutter/flutter#186788)
2026-07-13 [email protected] Roll Skia from 8bf65996caba to 3d1fc554f1a2 (2 revisions) (flutter/flutter#189350)
2026-07-13 [email protected] Roll Dart SDK from 0fc1668c4af4 to 2c587df8f05a (9 revisions) (flutter/flutter#189351)
2026-07-13 [email protected] [web] Fall back to full CJK fonts for characters not covered by split slices (flutter/flutter#188890)
2026-07-13 [email protected] Take Mac tool_integration_tests_* out of bringup (flutter/flutter#189368)
2026-07-13 [email protected] [hooks] Roll record_use to 1.0 and unpin (flutter/flutter#189366)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC [email protected],[email protected] on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD engine flutter/engine related. See also e: labels. platform-web Web applications specifically team-web Owned by Web platform team will affect goldens Changes to golden files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[web] Some of NotoSans KR glyphs are not fetched from google CDN after flutter 3.24.0

2 participants