Skip to content
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

IOS 13.3 TextStyle FontWeight being completely Ignored #49492

Closed
x4080 opened this issue Jan 25, 2020 · 53 comments · Fixed by #51665
Closed

IOS 13.3 TextStyle FontWeight being completely Ignored #49492

x4080 opened this issue Jan 25, 2020 · 53 comments · Fixed by #51665
Assignees
Labels
a: typography Text rendering, possibly libtxt c: regression It was better in the past than it is now customer: crowd Affects or could affect many people, though not necessarily a specific customer. dependency: skia Skia team may need to help us f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. platform-ios iOS applications specifically

Comments

@x4080
Copy link

x4080 commented Jan 25, 2020

Hi, after upgrade my ios to 13.3, my flutter app cannot display bold (compare to before upgrade and in android)

Is it problem with ios 13.3 ? Or there's breaking changes in flutter for ios ? Android works fine

@iapicca
Copy link
Contributor

iapicca commented Jan 27, 2020

Hi @x4080
can you please provide your flutter doctor -v ,
and if possible a reproducible minimal code sample.
Thank you

@iapicca iapicca added the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 27, 2020
@x4080
Copy link
Author

x4080 commented Jan 28, 2020

@iapicca Thanks for quick response,

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v1.14.5-pre.35, on Mac OS X 10.14.5 18F132, locale en-ID)
 
[!] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor --android-licenses
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
[!] Android Studio (version 3.5)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] VS Code (version 1.41.1)
[!] Connected device
    ! No devices available

! Doctor found issues in 3 categories.

Source is using default flutter create [projectname]

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        // This is the theme of your application.
        //
        // Try running your application with "flutter run". You'll see the
        // application has a blue toolbar. Then, without quitting the app, try
        // changing the primarySwatch below to Colors.green and then invoke
        // "hot reload" (press "r" in the console where you ran "flutter run",
        // or simply save your changes to "hot reload" in a Flutter IDE).
        // Notice that the counter didn't reset back to zero; the application
        // is not restarted.
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  // This widget is the home page of your application. It is stateful, meaning
  // that it has a State object (defined below) that contains fields that affect
  // how it looks.

  // This class is the configuration for the state. It holds the values (in this
  // case the title) provided by the parent (in this case the App widget) and
  // used by the build method of the State. Fields in a Widget subclass are
  // always marked "final".

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  int _counter = 0;

  void _incrementCounter() {
    setState(() {
      // This call to setState tells the Flutter framework that something has
      // changed in this State, which causes it to rerun the build method below
      // so that the display can reflect the updated values. If we changed
      // _counter without calling setState(), then the build method would not be
      // called again, and so nothing would appear to happen.
      _counter++;
    });
  }

  @override
  Widget build(BuildContext context) {
    // This method is rerun every time setState is called, for instance as done
    // by the _incrementCounter method above.
    //
    // The Flutter framework has been optimized to make rerunning build methods
    // fast, so that you can just rebuild anything that needs updating rather
    // than having to individually change instances of widgets.
    return Scaffold(
      appBar: AppBar(
          // Here we take the value from the MyHomePage object that was created by
          // the App.build method, and use it to set our appbar title.
          title:
              // Text(widget.title,
              //           style: Theme.of(context).primaryTextTheme.headline5,)
              Text(
        widget.title,
        style: TextStyle(fontWeight: FontWeight.bold, fontSize: 25),
      )),
      body: Center(
        // Center is a layout widget. It takes a single child and positions it
        // in the middle of the parent.
        child: Column(
          // Column is also a layout widget. It takes a list of children and
          // arranges them vertically. By default, it sizes itself to fit its
          // children horizontally, and tries to be as tall as its parent.
          //
          // Invoke "debug painting" (press "p" in the console, choose the
          // "Toggle Debug Paint" action from the Flutter Inspector in Android
          // Studio, or the "Toggle Debug Paint" command in Visual Studio Code)
          // to see the wireframe for each widget.
          //
          // Column has various properties to control how it sizes itself and
          // how it positions its children. Here we use mainAxisAlignment to
          // center the children vertically; the main axis here is the vertical
          // axis because Columns are vertical (the cross axis would be
          // horizontal).
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Text(
              'You have pushed the button this many times:',
            ),
            Text(
              '$_counter',
              style: Theme.of(context).textTheme.headline4,
            ),
          ],
        ),
      ),
      floatingActionButton: FloatingActionButton(
        onPressed: _incrementCounter,
        tooltip: 'Increment',
        child: Icon(Icons.add),
      ), // This trailing comma makes auto-formatting nicer for build methods.
    );
  }
}

android emulator
ios simulator 13 3

Attached the result in ios simulator and android emulator using bold

Bold is not displaying in IOS

(edited)

@no-response no-response bot removed the waiting for customer response The Flutter team cannot make further progress on this issue until the original reporter responds label Jan 28, 2020
@pamir72
Copy link

pamir72 commented Jan 28, 2020

Confirm. Flutter 1.14.5. iOS 13.3. Font with bold weight (and w500, w600, w700 .....) is not displayed for the emulator and on the real device.

@x4080
Copy link
Author

x4080 commented Jan 28, 2020

@pamir72 thanks so its not just me

@x4080 x4080 changed the title IOS 13.3 textstyle headline5 is not bold now IOS 13.3 textstyle headline5 is not bold now, edit bold is not working not because of headline5 Jan 28, 2020
@pamir72
Copy link

pamir72 commented Jan 28, 2020

It's not only headline5. Any with bold for me

@iapicca iapicca added a: typography Text rendering, possibly libtxt f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. platform-ios iOS applications specifically c: regression It was better in the past than it is now labels Jan 28, 2020
@iapicca iapicca added the customer: crowd Affects or could affect many people, though not necessarily a specific customer. label Jan 28, 2020
@calvinmuller

This comment has been minimized.

@josh-burton
Copy link
Contributor

For me the issue is reversed - all fonts are bold and don't respect the FontWeight.

@Crisis2010

This comment has been minimized.

@roysprojects
Copy link

This isn't exclusive to iOS. I don't know if it's a problem with my phone, but when the apk is installed on my phone, fontWeight is completely ignored and my Text widgets don't look the same as they do on the simulator.

@Livinglist
Copy link

Same here. FontWeight is not working properly on iOS

@edeuss
Copy link

edeuss commented Feb 5, 2020

The issue has made it to the beta channel, not just in master or dev channels @iapicca

Thought it was just the Emulator but tested it on a iPhone 11 Pro, iPhone 7 and 2 5's

@dpedrinha
Copy link

dpedrinha commented Feb 6, 2020

I'm also facing this problem. And I'm not using headline5. I'm using:

TextStyle(
    fontWeight: FontWeight.bold,
  )

But I didn't figure it was related to the iOS version. I thought it was a problem with device models.
Newer devices doesn't show bold and older devices do.
I created a test app for that if needed.
https://github.com/dpedrinha/ios-bold-text-bug
Just build and run. It shows bold on iPhone 6 but not on 11.

@mrm
Copy link

mrm commented Feb 6, 2020

I can confirm this is related to the flutter version, with the latest flutter version all my headings are no longer bold. My previous build, with an older flutter version, works as it should on an iPhone 11 pro with the latest iOS version.

@Jethro87
Copy link

Jethro87 commented Feb 6, 2020

Same issue for me - nothing is bold on iOS anymore. Running the app on an iPhone 8.

[✓] Flutter (Channel beta, v1.14.6, on Mac OS X 10.15.2 19C57, locale en-CA)
    • Flutter version 1.14.6 at /Users/jb/flutter
    • Framework revision fabeb2a16f (9 days ago), 2020-01-28 07:56:51 -0800
    • Engine revision c4229bfbba
    • Dart version 2.8.0 (build 2.8.0-dev.5.0 fc3af737c7)

 
[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/jb/Library/Android/sdk
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /Users/jb/Library/Android/sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C504
    • CocoaPods version 1.8.4

[✓] Android Studio (version 3.5)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 42.1.1
    • Dart plugin version 191.8593
    • Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)

[✓] VS Code (version 1.41.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.8.1

[✓] Connected device (1 available)
    • Jeff’s iPhone • 5d74ad2c2d551bab66cb5ed48c075deb99ed77bc • ios • iOS 13.3

@edeuss
Copy link

edeuss commented Feb 7, 2020

@x4080 Probably should just change the title to “TextStyle FontWeight being completely Ignored”

@x4080 x4080 changed the title IOS 13.3 textstyle headline5 is not bold now, edit bold is not working not because of headline5 IOS 13.3 TextStyle FontWeight being completely Ignored Feb 9, 2020
@sanekyy
Copy link

sanekyy commented Feb 9, 2020

Same issue. Faced in beta channel.

@dnfield
Copy link
Contributor

dnfield commented Feb 20, 2020

There is a patch for Skia that should fix this being reviewed now.

Unfortunately, the internals of this involve a bunch of strangeness around the way CoreText handles fonts. It's not a trivial thing to manage or just ifdef out. And unfortunately, the severity of this bug did not come to the attention of anyone who could act on it until well after it had been reported.

This is very actively being worked on, and should have a resolution soon. For now, your best bet is to use the stable channel of Flutter, and avoid beta until this is resolved.

@dpedrinha
Copy link

dpedrinha commented Feb 20, 2020

Thanks for the reply @dnfield.
I'm using master because the stable were giving me other problems. Maybe it's fixed now, I'll give it a try.

@x4080
Copy link
Author

x4080 commented Feb 20, 2020

@dpedrinha Is it fix now in master ? I'm using master too

@dnfield
Copy link
Contributor

dnfield commented Feb 22, 2020

https://skia-review.googlesource.com/c/skia/+/272116 Is the latest attempt.

No, this is still not fixed on master.

@dpedrinha
Copy link

dpedrinha commented Feb 23, 2020

I tried using the stable channel but then I get Error: No named parameter with the name 'bodyText2'. and I can't compile. If I use body2, I keep getting a warning of it being deprecated and that I should use bodyText2. Which doesn't work.
So the stable channel is not that stable.
But if I use the stable channel and ignore the warning, the bold texts work.

@lukepighetti
Copy link

lukepighetti commented Feb 23, 2020

Can someone provide an ETA on this landing on dev? If not, I'd like to request a revert on dev branch or a release on stable to bring in the new material typography properties. Much appreciated.

@howieweiner
Copy link

Please can you advise what version I can revert to, to mitigate this issue? I assume this is possible? Thx

@dpedrinha
Copy link

Please can you advise what version I can revert to, to mitigate this issue? I assume this is possible? Thx

Stable version is working.

flutter channel stable does the trick.

@lukepighetti
Copy link

Stable works but it’s missing the new material theme properties which one of our apps depends on heavily.

@xster
Copy link
Member

xster commented Feb 25, 2020

https://skia-review.googlesource.com/c/skia/+/272116 landed upstream in Skia. It'll take a day or 2 for it to percolate through to Flutter master.

@dnfield
Copy link
Contributor

dnfield commented Feb 27, 2020

This should be fixed on master now, after #51480

Can anyone experiencing this pleast test on master and verify?

@passsy
Copy link
Contributor

passsy commented Feb 28, 2020

I can verify the fix is working.

Side note: Upgrading from beta to master wasn't easy due to some recent breaking changes I ran into #48346, #44930, #51435

@gliese667c
Copy link

Verified too, on master commit 1cc8cc299

@sanekyy
Copy link

sanekyy commented Feb 28, 2020

I confirm, fixed.

@scopendo
Copy link

scopendo commented Feb 29, 2020

@dnfield will this be expedited to the beta channel, or are the dependencies too big to allow it?

@dnfield
Copy link
Contributor

dnfield commented Feb 29, 2020

@tvolkert

@tvolkert
Copy link
Contributor

@scopendo it should make it to the beta channel in the next beta release, but it won't be cherry-picked, so the next beta release will also contain the API-breaking changes you see on master.

@jlubeck
Copy link
Contributor

jlubeck commented Mar 5, 2020

Hey @tvolkert. I'm new to flutter dev so sorry if this is an obvious question. But are there periodic releases to beta channel or is it just "whenever it happens"? Just trying to figure out if I can wait for this or find an alternative. Thank you!

@tvolkert
Copy link
Contributor

tvolkert commented Mar 5, 2020

@jlubeck see https://github.com/flutter/flutter/wiki/Release-process#rolling-the-beta-channel. tldr: beta releases are generally once a month early in the month (will likely be early next week).

Side-note: we're in the process of defining a new release process that should allow us to publish a calendar so people can plan on our beta and stable releases. Stay tuned 🙂

@jlubeck
Copy link
Contributor

jlubeck commented Mar 5, 2020

Nice, thank you @tvolkert !

@jlubeck
Copy link
Contributor

jlubeck commented Mar 18, 2020

Nice, beta was published and this is now fixed on beta channel

@lock
Copy link

lock bot commented Apr 2, 2020

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 flutter doctor -v and a minimal reproduction of the issue.

@lock lock bot locked and limited conversation to collaborators Apr 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
a: typography Text rendering, possibly libtxt c: regression It was better in the past than it is now customer: crowd Affects or could affect many people, though not necessarily a specific customer. dependency: skia Skia team may need to help us f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. platform-ios iOS applications specifically
Projects
None yet