Skip to content

[Impeller] Different font weight vs Skia (light on dark) #127810

Closed as not planned

Description

@PiN73

Starting from Flutter 3.10, Impeller is used by default on iOS. Small text seems to render noticeably different

Steps to reproduce

  1. Create new app

  2. Place light text on dark background

ColoredBox(
  color: Colors.black,
  child: Text('Hello', style: TextStyle(color: Colors.white)),
)
  1. Run the app with Flutter 3.10.2 on iOS

Expected results

The text should render like in Skia

dark_skia

Actual results

The text renders thinner

dark_impeller

Details

Full code sample
import 'package:flutter/material.dart';

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return const MaterialApp(
      home: Material(
        color: Colors.black,
        child: Center(
          child: Text(
            'Hello',
            style: TextStyle(
              color: Colors.white,
            ),
          ),
        ),
      ),
    );
  }
}

To reproduce old Skia behavior on Flutter 3.10

flutter run --no-enable-impeller

To crop and scale screenshot (iPhone 14):

convert screenshot.png -gravity center -crop 100x40+0+0 -scale 800% out.png
Tools versions
Flutter (Channel stable, 3.10.2, on macOS 13.3.1 22E261 darwin-arm64, locale en-RU)
Xcode - develop for iOS and macOS (Xcode 14.3)
Android Studio (version 2022.2)

Flutter 3.10.2 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 9cd3d0d9ff (6 days ago) • 2023-05-23 20:57:28 -0700
Engine • revision 90fa3ae28f
Tools • Dart 3.0.2 • DevTools 2.23.1

All the same on master:

Flutter 3.11.0-14.0.pre.70 • channel master •
https://github.com/flutter/flutter.git
Framework • revision bd11ef06fd (8 hours ago) • 2023-05-29 11:50:25 -0400
Engine • revision f768be1078
Tools • Dart 3.1.0 (build 3.1.0-155.0.dev) • DevTools 2.23.1

Activity

  1. PiN73 commented on May 29, 2023

    @PiN73
    Author

    Note: if we swap the colors (dark on light), Impeller font weight matches Skia (could have been fixed in #119234)

    Skia

    light_skia

    Impeller

    light_impeller

    The only thing which still looks wrong is kerning: #127815

  2. PiN73 commented on May 29, 2023

    @PiN73
    Author

    Just noticed that native version looks more similar to Impeller than Skia

    dark_swiftui
    import SwiftUI
    
    struct ContentView: View {
        var body: some View {
            Text("Hello")
            .font(.system(size: 14))
            .foregroundColor(.white)
            .frame(maxWidth: .infinity, maxHeight: .infinity)
            .ignoresSafeArea()
            .background(.black)
        }
    }
    
    struct ContentView_Previews: PreviewProvider {
        static var previews: some View {
            ContentView()
        }
    }

    So maybe it was Skia that was wrong 🤔

  3. added
    in triagePresently being triaged by the triage team
    on May 30, 2023
  4. huycozy commented on May 30, 2023

    @huycozy
    Member

    Hi @PiN73
    Thanks for the detailed report! However, this is a known issue being tracked at #120857. You can take a look at #120857 (comment) that also compared different between Skia and Impeller. Per your last test on iOS native, it matched with Impeller output.

    Since Impeller is enabled by default from 3.10, I assume this issue has been fixed. If you still go with Skia, please follow #120857 for further updates.

    Closing the issue as a duplicate. Thank you!

  5. added
    r: duplicateIssue is closed as a duplicate of an existing issue
    and removed
    in triagePresently being triaged by the triage team
    on May 30, 2023
  6. github-actions commented on Jun 13, 2023

    @github-actions

    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.

  7. locked as resolved and limited conversation to collaborators on Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    r: duplicateIssue is closed as a duplicate of an existing issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions