Skip to content

Using a font with an unsupported font weight leads to flaky behavior #31212

@enetor

Description

@enetor

A Googler found this issue when debugging flaky tests.

Steps to Reproduce

The test includes font weights of 500 and 700 for Roboto.

When the test code uses font weight 600, rendering becomes flaky as sometimes 500 is chosen and other times 700.

Expected Behavior

Either:

  1. Flutter throws an error or a warning to indicate an unsupported font;

Or:
2) Flutter chooses a nearest font weight in a deterministic way.

fandeng@marshmallow:~$ flutter doctor -v
[✓] Flutter (Channel beta, v1.4.9-hotfix.1, on Linux, locale en_US.UTF-8)
• Flutter version 1.4.9-hotfix.1 at [reducted]
• Framework revision 88fa7ea (6 days ago), 2019-04-11 14:01:46 -0700
• Engine revision 4737fc5cd8
• Dart version 2.2.1 (build 2.2.1-dev.4.0 None)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
• Android SDK at [reducted]
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-stable, build-tools 28.0.3
• Java binary at: /opt/android-studio-with-blaze-3.3/jre/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
• All Android licenses accepted.

[✓] Android Studio (version 3.3)
• Android Studio at /opt/android-studio-with-blaze-3.3
• Flutter plugin version 32.0.1
• Dart plugin version 182.5215
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] IntelliJ IDEA Community Edition (version 2018.3)
• IntelliJ at /opt/intellij-ce-2018.3
• Flutter plugin version 34.0.2
• Dart plugin version 183.5912.23

[✓] Connected device (2 available)
• Nexus 5X • [reducted] • android-arm64 • Android 8.1.0 (API 27)
• Pixel Android • emulator-5554 • android-x86 • Android 8.0.0 (API 26) (emulator)

• No issues found!

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: typographyText rendering, possibly libtxtcustomer: dream (g3)engineflutter/engine related. See also e: labels.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions