-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
CupertinoSystemText lookup issue #147708
Comments
Hey @MitchellGoodwin , |
Hi @yaroslav-kahaniak, just curious, what version of flutter were you using before you upgraded to 3.19.6? Was this working as expected for you on that version? |
@danagbemava-nc The app version that was running on Flutter v3.3.10 was using these font family names: I always use real device, but have just checked and can confirm that issue reproduces on simulator on Flutter upgrade from v3.7.0 to v3.10.0 |
Hi @yaroslav-kahaniak, on my iPhone XS running iOS 17.4.1, this is what I see whether or not I set a fallback font family. |
@danagbemava-nc |
My bad, I forgot to include the font. I tested with roboto and I do see the font change when the fallback font is present. Screen.Recording.2024-05-06.at.06.40.34.movsample usedimport 'package:flutter/material.dart';
import 'package:google_fonts/google_fonts.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
title: 'iOS Font Text',
home: HomeScreen(),
);
}
}
class HomeScreen extends StatelessWidget {
const HomeScreen({super.key});
@override
Widget build(BuildContext context) {
return Scaffold(
body: Center(
child: Text(
'You have pushed the button this many times:',
style: TextStyle(
fontFamilyFallback: [GoogleFonts.roboto().fontFamily!],
fontFamily: 'CupertinoSystemDisplay',
),
),
),
);
}
} flutter doctor -v
|
also cc @jason-simmons, any idea why a hot reload would have any impact on font loading? |
As of flutter/engine@0bbb4d6 If the text subsystem can not find a font with that family name, then the font fallback mechanism will select the default system font. But if the text style provides a If |
From flutter/engine#48937
|
So the fallback we originally had wasn't fully working. I wonder if registering a font with an unspecified weight for small text would work. |
Steps to reproduce
Important note: this issue doesn't reproduce for 'CupertinoSystemDisplay'
Expected results
Text style shouldn't change after doing step 2, since the lookup of the CupertinoSystemText should be successful, according to TextStyle documentation:
Actual results
Text style changes, so framework failed to find 'CupertinoSystemText' and picked font family from the fontFamilyFallback instead
Code sample
Code sample
Screenshots or Video
Screenshots or Video
With fontFamilyFallbackWithout fontFamilyFallback
Logs
Logs
Flutter Doctor output
Doctor output
Device info
Real device (not simulator)iOS 16.2
The text was updated successfully, but these errors were encountered: