flutter-packages
flutter-packages copied to clipboard
There is an issue with the Montserrat font if the phone setting “Bold text” is active
Package
google_fonts
Existing issue?
- [X] I checked the existing issues
What happened?
Expected vs actual result:
The digit "8" is broken at font-weight 200 and 300, starting at a certain font size. Later, I discovered that the capital letter 'Q' was also broken in some font-weights!!!
Steps to reproduce:
- Take a device with 2400*1080 resolution and Android 14 OS. (Samsung sm-a528b)
- Go to Settings -> Display -> Display size and text -> Turn on the switcher "Bold text"
- Run the following code:
import '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 MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
textTheme: GoogleFonts.montserratTextTheme(),
useMaterial3: true,
),
home: Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: const Text("Montserrat Font Test Page"),
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
const SizedBox(height: 50),
const Text('w200, fontSize22:'),
Text(
'abcdefghijklmnopqQrstuvwxyz 1234567890',
style: GoogleFonts.montserrat(fontWeight: FontWeight.w200, fontSize: 22),
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
const Text('w200, fontSize23 and above:'),
Text(
'abcdefghijklmnopqQrstuvwxyz 1234567890',
style: GoogleFonts.montserrat(fontWeight: FontWeight.w200, fontSize: 23),
textAlign: TextAlign.center,
),
const SizedBox(height: 50),
const Text('w300, fontSize15:'),
Text(
'abcdefghijklmnopqQrstuvwxyz 1234567890',
style: GoogleFonts.montserrat(fontWeight: FontWeight.w300, fontSize: 15),
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
const Text('w300, fontSize16 and above:'),
Text(
'abcdefghijklmnopqQrstuvwxyz 1234567890',
style: GoogleFonts.montserrat(fontWeight: FontWeight.w300, fontSize: 16),
textAlign: TextAlign.center,
),
const SizedBox(height: 20),
const Text('w300, fontSize32 and above:'),
Text(
'abcdefghijklmnopqQrstuvwxyz 1234567890',
style: GoogleFonts.montserrat(fontWeight: FontWeight.w300, fontSize: 32),
textAlign: TextAlign.center,
),
],
),
),
);
}
}
Relevant log output
[✓] Flutter (Channel stable, 3.16.8, on macOS 13.5.2 22G91 darwin-arm64, locale en-UA)
• Flutter version 3.16.8 on channel stable at /Users/nikolai/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 67457e669f (8 days ago), 2024-01-16 16:22:29 -0800
• Engine revision 6e2ea58a5c
• Dart version 3.2.5
• DevTools version 2.28.5
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.2)
• Android SDK at /Users/nikolai/Library/Android/sdk
• Platform android-33, build-tools 33.0.2
• ANDROID_HOME = /Users/nikolai/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)
• All Android licenses accepted.
[✓] Xcode - develop for iOS and macOS (Xcode 15.0.1)
• Xcode at /Applications/Xcode.app/Contents/Developer
• Build 15A507
• CocoaPods version 1.14.3
[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome
[✓] Android Studio (version 2023.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 17.0.7+0-17.0.7b1000.6-10550314)
[✓] Connected device (2 available)
• sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 14 (API 34) (emulator)
• Chrome (web) • chrome • web-javascript • Google Chrome 120.0.6099.234
[✓] Network resources
• All expected network resources are available.