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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Font fallback is misbehaving on iOS 13 for certain glyphs #40184
Comments
cc @GaryQian |
cc @jasonsimmons this must have happened after you fixed the incorrect fallback logic. |
@GaryQian @jason-simmons just to point out, if it wasn't clear enough, that this is not a regression inside Flutter code, as any version of the framework is presenting the same behaviour once the OS is updated to iOS 13 |
We rely on Coretext as a dependency to handle some of this behavior. Does this mean Apple has updated/broken/changed the API or its implementations? If so, preferably, changenotes would be helpful on figuring out how to respond to this. |
flutter/engine#12426 Has landed and may fix this bug. If Apple changed the font name, it could have impacted the order we previously loaded fallback fonts. Can you confirm if this bug still exists? |
I've just seen this, sorry. Going to test it tomorrow morning as first thing, thanks. |
Thanks for checking, We can continue to look at this then independently from the other issues. |
Same on Android, Flutter 1.12. For example, symbol ₽ is present in Roboto but not OpenSans. Let's look at three cases: fontFamily is not specifiedText('₽') In this case Flutter uses default font for Android — Roboto, and the symbol is rendered correctly. fontFamily does not support the symbol, fontFamilyFallback is not specifiedText('₽', style: TextStyle(
fontFamily: 'OpenSans',
)) According to docs, if all font families are exhausted and no match was found, the default platform font family will be used instead. But actually instead of symbol from Roboto it renders a box. fontFamily does not support the symbol, fontFamilyFallback is specified explicitly (.ttf font asset is used for Roboto)Text('₽', style: TextStyle(
fontFamily: 'OpenSans',
fontFamilyFallback: ['Roboto'],
)) In this case fallback works. But it would be good if system font is used as fallback implicitly |
The issue reproduces on iOS 14 as well code sampleimport 'package:flutter/material.dart';
void main() {
runApp(MaterialApp(
home: Center(
child: Text(
'\u{2713}',
style: TextStyle(
fontFamily: 'HelveticaNeue',
decoration: TextDecoration.none,
),
),
)));
}
flutter doctor -v[✓] Flutter (Channel master, 1.24.0-4.0.pre.82, on Mac OS X 10.15.7 19H2
darwin-x64, locale en-GB)
• Flutter version 1.24.0-4.0.pre.82 at /Users/tahatesser/Code/flutter_master
• Framework revision e5814756a2 (4 hours ago), 2020-10-27 01:47:03 -0700
• Engine revision 1857470267
• Dart version 2.11.0 (build 2.11.0-260.0.dev)
[✓] Android toolchain - develop for Android devices (Android SDK version 30.0.2)
• Android SDK at /Users/tahatesser/Code/sdk
• Platform android-30, build-tools 30.0.2
• ANDROID_HOME = /Users/tahatesser/Code/sdk
• Java binary at: /Applications/Android
Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 12.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 12.1, Build version 12A7403
• CocoaPods version 1.10.0.rc.1
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 4.1)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build
1.8.0_242-release-1644-b3-6222593)
[✓] VS Code (version 1.50.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.15.1
[✓] Connected device (3 available)
• macOS (desktop) • macos • darwin-x64 • Mac OS X 10.15.7 19H2
darwin-x64
• Web Server (web) • web-server • web-javascript • Flutter Tools
• Chrome (web) • chrome • web-javascript • Google Chrome
86.0.4240.111
• No issues found! |
any progress? |
Verified this using latest master and running the code sample on iOS 15.3 and it shows the expected result as below: Since I don't have iOS 13 or 14 to verify this behavior on, @sroddy is it possible for you to verify on said iOS version (13) and confirm if this is still an issue using latest master version ? |
Without additional information, we are unfortunately not sure how to resolve this issue. We are therefore reluctantly going to close this bug for now. |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of |
Steps to Reproduce
The following issue only occurs on iOS 13. Reproduced on the latest 2 stable releases (1.7.8 and 1.9.1).
Certain glyphs (e.g. U+2713) render as a square if you set a font family that do not contain them. Setting a font fallback family does not help either, while specifying a font family that contains the symbol (e.g. SF Pro Text Regular) does make it display right.
Interestingly enough, other glyphs (e.g. U+2714) handle fallback correctly and are displayed correctly.
Screenshot of bad behaviour (iOS 13):
Screenshot of good behaviour (iOS 12.4)
Logs
flutter doctor -v
[✓] Flutter (Channel unknown, v1.9.1+hotfix.3-pre.3, on Mac OS X 10.14.6 18G87, locale it-IT)
• Flutter version 1.9.1+hotfix.3-pre.3 at /Users/sroddy_bs/flutter/flutter
• Framework revision a29de57 (6 days ago), 2019-09-04 14:25:10 +0200
• Engine revision b863200
• Dart version 2.5.0
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at /Users/sroddy_bs/Library/Android/sdk
• Android NDK at /Users/sroddy_bs/Library/Android/sdk/ndk-bundle
• Platform android-28, build-tools 28.0.3
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 10.3)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 10.3, Build version 10G8
• CocoaPods version 1.7.4
[✓] Android Studio (version 3.4)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 19.1
• Dart plugin version 171.4424
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
[✓] IntelliJ IDEA Community Edition (version 2019.2.1)
• IntelliJ at /Applications/IntelliJ IDEA CE.app
• Flutter plugin version 39.0.5
• Dart plugin version 192.6262.58
[✓] VS Code (version 1.33.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.0.0
[✓] Connected device (1 available)
• iPhone SE • 96789764-DE45-4281-AD1E-E17C17D1FDB0 • ios • com.apple.CoreSimulator.SimRuntime.iOS-12-4 (simulator)
• No issues found!
The text was updated successfully, but these errors were encountered: