Skip to content

Web HTML renderer reports rounded text height & alphabetic baseline location #122066

@LongCatIsLooong

Description

@LongCatIsLooong

#121306 was reverted because the web HTML renderer is reporting rounded text height / alphabetic baseline metrics.

failures:
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8787337181803429201/+/u/run_test.dart_for_web_tests_shard_and_subshard_7_last/test_stdout
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8787337181024748465/+/u/run_test.dart_for_web_tests_shard_and_subshard_3/test_stdout
https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8787337181024748497/+/u/run_test.dart_for_web_tests_shard_and_subshard_1/test_stdout

When fontSize = 14 and textScaleFactor = 1.0, with the "FlutterTest" font the text height should be exactly 14.0, and the baseline location should be 14 / 1024 * 768 = 10.5. But the HTML renderer is reporting a text height of 15.0 and a baseline offset of 11.0.

For now I'm going to change the font size used in the failing tests to multiples of 4 to avoid the rounding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: typographyText rendering, possibly libtxte: web_htmlHTML rendering backend for Webengineflutter/engine related. See also e: labels.platform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions