You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 94a2620
Browse filesBrowse the repository at this point in the historyBrowse files
fix(engine): fall back to host fonts for scripts beyond CJK and emoji
On macOS only Hiragino and Apple Color Emoji were loaded, so Simplified
Chinese characters Japanese lacks, Hangul, Thai, Arabic, Hebrew, and
Devanagari rendered as boxes in a shot reported ok. The harness now
loads a fallback family per script on macOS, Linux, and Windows, after
the CJK and emoji ones, so text that rendered before renders unchanged.
The manual lists the fonts per host.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,7 @@ Host fallback fonts in text whose style keeps them out.
7
7
* CJK and emoji in a `CupertinoAlertDialog` rendered as boxes in a shot reported `ok`: their text styles inherit nothing and name the Cupertino system font, so the host fonts added to the default text style and the themes never reached them. The host fonts are now appended to the text of every paragraph and text field before each layout.
8
8
* Text in a style with its own `fontFamilyFallback`, such as google_fonts', now falls back to the host fonts too; Japanese in a Latin-only Google font rendered as boxes.
9
9
* Text in a package font's style falls back as well.
10
+
* Simplified Chinese, Hangul, Thai, Arabic, Hebrew, and Devanagari fall back to host fonts too; on macOS they rendered as boxes, and only Hiragino and Apple Color Emoji were loaded. Text that rendered before renders unchanged.
Copy file name to clipboardExpand all lines: doc/manual.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -132,7 +132,7 @@ Images render at a device pixel ratio of 2.
132
132
Elevation paints its shadow as on a device; `flutter_test` would draw a solid outline in its place.
133
133
134
134
Fonts: every family in the project's `FontManifest.json` (pubspec `fonts:`, package fonts, MaterialIcons) plus Roboto from the Flutter SDK cache.
135
-
The test engine has no system font fallback, so a glyph missing from the style's fonts would render as a box. As on a device, shutter falls back to the host's CJK and emoji fonts: Hiragino Sans W3/W6 and Apple Color Emojion macOS, Noto Sans CJK and Noto Color Emojion Linux, Yu Gothic and Segoe UI Emoji on Windows. They are appended as `fontFamilyFallback` to the ambient default text style, and to the text theme of every design library whose theme the shell provides (SDK or package); text whose glyphs exist in its own font renders unchanged.
135
+
The test engine has no system font fallback, so a glyph missing from the style's fonts would render as a box. As on a device, shutter falls back to the host's fonts for CJK and emoji, then for the scripts those lack: Simplified Chinese, Hangul, Thai, Arabic, Hebrew, and Devanagari. On macOS they are Hiragino Sans W3/W6, Apple Color Emoji, Hiragino Sans GB, Apple SD Gothic Neo, Thonburi, SF Arabic, SF Hebrew, and Kohinoor Devanagari; on Linux, Noto Sans CJK, Noto Color Emoji, and Noto Sans Thai, Arabic, Hebrew, and Devanagari; on Windows, Yu Gothic, Segoe UI Emoji, Microsoft YaHei, Malgun Gothic, Leelawadee UI, Segoe UI, and Nirmala UI. A Han character takes the Japanese form when the CJK font has it. They are appended as `fontFamilyFallback` to the ambient default text style, and to the text theme of every design library whose theme the shell provides (SDK or package); text whose glyphs exist in its own font renders unchanged.
136
136
Each frame, before layout, they are also appended to the text of every paragraph and text field, so text whose style keeps them out falls back too: a style that inherits nothing, such as a `CupertinoAlertDialog`'s, or one with its own `fontFamilyFallback`, such as google_fonts'.
137
137
Cupertino text names the system font through the families `CupertinoSystemText` and `CupertinoSystemDisplay`, which the test engine does not resolve. On a macOS host they get SF Pro from `/System/Library/Fonts/`, as a macOS app does and as iOS draws; on other hosts, Roboto, the Android system font.
138
138
Host fonts come from the machine that shoots, so compare runs made on the same machine.
Copy file name to clipboardExpand all lines: lib/src/cli/manual_text.dart
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -135,7 +135,7 @@ Images render at a device pixel ratio of 2.
135
135
Elevation paints its shadow as on a device; `flutter_test` would draw a solid outline in its place.
136
136
137
137
Fonts: every family in the project's `FontManifest.json` (pubspec `fonts:`, package fonts, MaterialIcons) plus Roboto from the Flutter SDK cache.
138
-
The test engine has no system font fallback, so a glyph missing from the style's fonts would render as a box. As on a device, shutter falls back to the host's CJK and emoji fonts: Hiragino Sans W3/W6 and Apple Color Emojion macOS, Noto Sans CJK and Noto Color Emojion Linux, Yu Gothic and Segoe UI Emoji on Windows. They are appended as `fontFamilyFallback` to the ambient default text style, and to the text theme of every design library whose theme the shell provides (SDK or package); text whose glyphs exist in its own font renders unchanged.
138
+
The test engine has no system font fallback, so a glyph missing from the style's fonts would render as a box. As on a device, shutter falls back to the host's fonts for CJK and emoji, then for the scripts those lack: Simplified Chinese, Hangul, Thai, Arabic, Hebrew, and Devanagari. On macOS they are Hiragino Sans W3/W6, Apple Color Emoji, Hiragino Sans GB, Apple SD Gothic Neo, Thonburi, SF Arabic, SF Hebrew, and Kohinoor Devanagari; on Linux, Noto Sans CJK, Noto Color Emoji, and Noto Sans Thai, Arabic, Hebrew, and Devanagari; on Windows, Yu Gothic, Segoe UI Emoji, Microsoft YaHei, Malgun Gothic, Leelawadee UI, Segoe UI, and Nirmala UI. A Han character takes the Japanese form when the CJK font has it. They are appended as `fontFamilyFallback` to the ambient default text style, and to the text theme of every design library whose theme the shell provides (SDK or package); text whose glyphs exist in its own font renders unchanged.
139
139
Each frame, before layout, they are also appended to the text of every paragraph and text field, so text whose style keeps them out falls back too: a style that inherits nothing, such as a `CupertinoAlertDialog`'s, or one with its own `fontFamilyFallback`, such as google_fonts'.
140
140
Cupertino text names the system font through the families `CupertinoSystemText` and `CupertinoSystemDisplay`, which the test engine does not resolve. On a macOS host they get SF Pro from `/System/Library/Fonts/`, as a macOS app does and as iOS draws; on other hosts, Roboto, the Android system font.
141
141
Host fonts come from the machine that shoots, so compare runs made on the same machine.
0 commit comments