Repository navigation
Open
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxtengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8Found to occur in 3.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team
Description
Steps to Reproduce
- Execute
flutter runon the code sample. - Take a screenshot of the Flutter app.
- Compose a new message in iOS Mail with the same text.
- Take screenshots of iOS Mail in light mode and dark mode.
- Compare the text in the screenshots to the screenshot of the Flutter app.
Expected results:
The font weights look the same.
Actual results:
The font weight in Flutter is too light in light mode and too heavy in dark mode. This makes the app look quite different in one mode compared to the other.
Code sample
import 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
alignment: Alignment.center,
height: 56.0,
child: const Text(
'The quick brown fox jumps over the lazy dog',
style: TextStyle(
color: Colors.black,
fontSize: 17.0,
letterSpacing: -0.43,
),
),
),
Container(
alignment: Alignment.center,
color: const Color.fromRGBO(28, 28, 30, 1),
height: 56.0,
child: const Text(
'The quick brown fox jumps over the lazy dog',
style: TextStyle(
color: Colors.white,
fontSize: 17.0,
letterSpacing: -0.43,
),
),
),
],
),
backgroundColor: Colors.white,
),
);
}
}Details
[flutter] flutter doctor -v
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.2.1 22D68 darwin-x64, locale en-US)
• Flutter version 3.7.3 on channel stable at /Users/anthonymoretti/Development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 9944297138 (7 days ago), 2023-02-08 15:46:04 -0800
• Engine revision 248290d6d5
• Dart version 2.19.2
• DevTools version 2.20.1
[✗] Android toolchain - develop for Android devices
✗ Unable to locate Android SDK.
Install Android Studio from: https://developer.android.com/studio/index.html
On first launch it will assist you in installing the Android SDK components.
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
If the Android SDK has been installed to a custom location, please use
`flutter config --android-sdk` to update to that location.
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 14C18
• CocoaPods version 1.11.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[!] Android Studio (not installed)
• Android Studio not found; download from https://developer.android.com/studio/index.html
(or visit https://flutter.dev/docs/get-started/install/macos#android-setup for detailed instructions).
[✓] VS Code (version 1.75.1)
• VS Code at /Applications/Visual Studio Code.app/Contents
• Flutter extension version 3.58.0
[✓] Connected device (3 available)
• iPhone 14 Pro (mobile) • ED506CAA-EB76-47D8-BBDC-751CB0EE7EC8 • ios • com.apple.CoreSimulator.SimRuntime.iOS-16-2 (simulator)
• macOS (desktop) • macos • darwin-x64 • macOS 13.2.1 22D68 darwin-x64
• Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.100
[✓] HTTP Host Availability
• All required HTTP hosts are available
! Doctor found issues in 2 categories.
exit code 0
Reacted by Greg Price, Hitesh Kumar Saini, Mauricio Cuenca, Hudson Afonso, PiN73, Etienne Théodore, delfme, rablexxx, Kane Wickman, 12people and 5 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work lista: typographyText rendering, possibly libtxtText rendering, possibly libtxtengineflutter/engine related. See also e: labels.flutter/engine related. See also e: labels.found in release: 3.7Found to occur in 3.7Found to occur in 3.7found in release: 3.8Found to occur in 3.8Found to occur in 3.8has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onplatform-iosiOS applications specificallyiOS applications specificallyteam-iosOwned by iOS platform teamOwned by iOS platform teamtriaged-iosTriaged by iOS platform teamTriaged by iOS platform team

Activity
HylkeReinders commentedon Feb 16, 2023
Hi Anthony,
Just checked your screenshot and i didn't see a difference when checking the widths in Figma.
For the black:

For the White:

What I do see is that with the black text we have a dark border and that is the same for the white text color. That could be lighter? So it looks like the same width?
anthonymoretti commentedon Feb 16, 2023
Hi Hylke
Thanks for looking into it. Yeah the border color in both light and dark modes needs to be darker, otherwise it looks like the weights are off. The change is especially noticeable when switching from light mode to dark mode and vice versa.
The border color of the letter "h" is a good example. If you compare the border color of each "h" to the one below it you can see how the border color of the bottom one is too light in both cases. If it could be changed to match the border color of the "h" above it that would fix it I think.
huycozy commentedon Feb 16, 2023
Hi @anthonymoretti
Can you please provide screenshots for the comparison between Flutter and iOS native? Honestly, I've tried to look closely but haven't noticed the difference yet. Should I pay attention to the border of the letters?
anthonymoretti commentedon Feb 16, 2023
Hi @huycozy
Yes, it's the border of the letters, which is too light in both light and dark modes. It creates the effect that text is too thin in light mode and too bold in dark mode.
Here are the screenshots:
delfme commentedon Feb 16, 2023
@huycozy please focus on the leg of "i" or on "k". First row (the thicker one) is native.
I couldn't test and it is not clear if the issue affects only skia, impeller or both engines.
However, I remembered this fix landed lately and it would be worth double-checking things work properly on Impeller #118613
anthonymoretti commentedon Feb 16, 2023
Hi @delfme. This is with Impeller enabled, but I think it existed before too.
anthonymoretti commentedon Feb 16, 2023
I realize it might be hard to see, so thought I'd try to make it easier. This is with Impeller, but I think it might have existed before too.
huycozy commentedon Feb 17, 2023
Thank you guys for more information. I double-check this and see that it's easier to see this issue in dark mode especially.
Demo
Demo (raw images)
Demo video
RPReplay_Final1676610434.MP4
But as @delfme mentioned above, this seems to be fixed with Impeller:
@anthonymoretti Can you retry on the latest master channel with Impeller and check if see the same result?
anthonymoretti commentedon Feb 17, 2023
Thanks for looking. I tried on the latest master with Impeller now but it's identical to stable. A second very minor thing, in Flutter there appears to be an extra pixel between "k" and "b", so the total line length is different by one pixel.
The reason I noticed the problem in the first place is because the text in my app appears thinned out in light mode compared to dark mode, and it seems to be because of a font weight imbalance between the modes.
flutter doctor -v
huycozy commentedon Feb 17, 2023
Labeling the issue for the team's attention since the issue is also happening on skia (see #120857 (comment) or above comments for the demo)
flutter doctor -v (stable and master)
[✓] Flutter (Channel stable, 3.7.3, on macOS 13.0.1 22A400 darwin-x64, locale en-VN) • Flutter version 3.7.3 on channel stable at /Users/huynq/Documents/GitHub/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 9944297138 (17 hours ago), 2023-02-08 15:46:04 -0800 • Engine revision 248290d6d5 • Dart version 2.19.2 • DevTools version 2.20.1 [✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0) • Android SDK at /Users/huynq/Library/Android/sdk • Platform android-33, build-tools 31.0.0 • ANDROID_HOME = /Users/huynq/Library/Android/sdk • Java binary at: /Users/huynq/Library/Java/JavaVirtualMachines/corretto-1.8.0_302/Contents/Home/bin/java • Java version OpenJDK Runtime Environment Corretto-8.302.08.1 (build 1.8.0_302-b08) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.1) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14B47b • CocoaPods version 1.11.3 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [!] Android Studio (version 2022.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 ✗ Unable to find bundled Java version. • Try updating or re-installing Android Studio. [✓] IntelliJ IDEA Community Edition (version 2022.1.1) • IntelliJ at /Users/huynq/Library/Application Support/JetBrains/Toolbox/apps/IDEA-C/ch-0/221.5591.52/IntelliJ IDEA CE.app • 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 [✓] VS Code (version 1.75.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.58.0 [✓] Connected device (3 available) • SM T225 (mobile) • R9JT3004VRJ • android-arm64 • Android 13 (API 33) • macOS (desktop) • macos • darwin-x64 • macOS 13.0.1 22A400 darwin-x64 • Chrome (web) • chrome • web-javascript • Google Chrome 110.0.5481.77 [✓] HTTP Host Availability • All required HTTP hosts are available ! Doctor found issues in 1 category.27 remaining items
delfme commentedon Oct 17, 2024
@anthonymoretti I lately had a closer look at Inter font suggested by @ManuelRauber and it seems it might be a good patch on iOS while waiting for a fix.
https://mattwestcott.org/blog/an-ode-to-the-inter-typeface
I still didnt try it on phone though.
delfme commentedon Oct 17, 2024
@anthonymoretti if you made time to test it, would you be so kind as to create a reference table to related what weight on iOS compare with Inter, both light and dark mode.
For example, on dark mode, SF 500 == Inter 480, just guessing.
delfme commentedon Oct 17, 2024
Quick report on this.
Download Inter font from here https://rsms.me/inter/
Add it to pubspec:
In my case, I got a native look with dark theme by setting
wghtto 450 (instead of SF 500) but it feels like this needs test. However, this is a valid workaround because font looks very similar to SF.Hope this helps.
delfme commentedon Nov 22, 2024
Unfortunately, the workaround above isn’t a solution, as some emojis will be rendered without color on both Android and iOS. This issue may be related to this GitHub issue.
To recap:
fontWeighton iOS is broken, causing text to appear thinner in light mode and ticker in dark mode.davidgreyme commentedon Dec 12, 2024
@delfme did you find any new usable workaround for this?
delfme commentedon Dec 12, 2024
This works #120857 (comment)
Make sure to adjust
strokeWidthaccordingly.The downside of this approach is that it will result in double texts appearing on the scene, but for now, this is the only viable solution.
If you are aiming to make your texts look native, keep in mind that there are other issues, including incorrect text height and fontSize, letterSpacing, emojis size and emoji offset. To observe them, display a multiline text—one using UILabel and the other with Flutter Text widget. You will be able to spot the discrepancies visually. #28894 (comment)
davidgreyme commentedon Dec 12, 2024
Thanks @delfme!
@MitchellGoodwin @jonahwilliams you seem to be the ones working on the native Cupertino font. Are you aware of these inconsistencies compared to the native iOS font?
jodinathan commentedon Feb 25, 2025
any news for this?
we are trying to reproduce a Figma file in Flutter but this is messing with the layout.
delfme commentedon Feb 27, 2025
I also mentioned our solutions to address the issue in the cupertino widgets
#120857 (comment)
It would be great if a fix could land sometime soon. Text fidelity is the most frequent complain we receive from iOS users. For the well-known emoji issue they report issue precisely, for this issue they described it vaguely with phrases like "texts look weird" or "things look weird". As soon as we applied our patch, they confirmed that "things look good".
If this can help, we also noticed a big difference between iOS and android users. The android users tend to tolerate issues, while iOS users don't.
dkwingsmt commentedon Feb 27, 2025
It seems that this thread is discussing two topics simultaneously. I recommend focusing the topic here on the fond weight of text.
For letter spacing and line spacing, I recommend discussing under #150824.
delfme commentedon Feb 27, 2025
@dkwingsmt my patch suggested above refers to the fontwieght issue only. But yes we also patched letter spacing and I shared our knowledge at the issue you linked above. Hope this helps.
delfme commentedon Jun 20, 2025
@bdero hope you don't mind the mention, but this critical bug seems unfixable after 2 years, and I was wondering if you might have any ideas for a solution at the engine level. Until it's resolved, Flutter texts rendering on iOS looks noticeably off: FontWeight.normal appears too light, almost like FontWeight.w300, while FontWeight.medium looks like an "thicker" normal. This makes it impossible to display text that looks truly ‘normal’ to users. Not sure why this is marked as P2, as it arguably accounts for about 60% of why text looks non-native on iOS.
delfme commentedon Jun 25, 2025
Could we get an explanation of what causes the fontWeight rendering to be inconsistent between Skia and Impeller?
Also, is there anything that could be done at the engine level to at least mitigate the issue? For example, could adjusting values like opacity, border, or anti-aliasing help?
delfme commentedon Jun 25, 2025
At first glance, the borders appear correct but lighter. Take a look at this zoomed-in image - the bottom row shows Flutter. The lighter border color makes the text appear to have a thinner fontWeight.
Perhaps a fix could involve adjusting the opacity - reducing it in light theme (to make the text appear ticker) and increasing it in dark theme (to make the text appear thinner).
CC: @jonahwilliams