Skip to content

Add space tracking metrics to LibTxt to properly include end-of-line spaces in bounding rects. #26658

Closed

Description

@GaryQian

Currently, we truncate white space at the end of lines when the text is centered.

Correct behavior should be that the white space still adds metrics but does not contribute to the centering or width of the text. This way, when spaces are typed, they still appear and the centering is not skewed.

This is extracted from #25312

Activity

  1. added
    a: text inputEntering text in a text field or keyboard related problems
    engineflutter/engine related. See also e: labels.
    a: typographyText rendering, possibly libtxt
    on Jan 16, 2019
  2. added this to the milestone on Jan 17, 2019
  3. GaryQian commented on Feb 12, 2019

    @GaryQian
    ContributorAuthor
  4. Hixie commented on Feb 12, 2019

    @Hixie
    Contributor

    There's an argument to be made that we shouldn't even trim the spaces in rendering, but I'm not sure if it's a valid argument or not.

  5. GaryQian commented on Feb 12, 2019

    @GaryQian
    ContributorAuthor

    The main goal of this is to achieve the same behavior that is present in android and iOS. It is straightforward to expose properties to toggle this, although I don't expect many people to ever use it.

    Either way, what we currently do (truncate completely) is wrong.

  6. GaryQian commented on Feb 12, 2019

    @GaryQian
    ContributorAuthor

    The changes in the engine to fix this should be rolled by #27808

  7. GaryQian commented on Feb 15, 2019

    @GaryQian
    ContributorAuthor

    The fix has landed in the engine, but is on hold before it is rolled into flutter/flutter.

  8. GaryQian commented on Feb 15, 2019

    @GaryQian
    ContributorAuthor

    The roll has landed!

  9. github-actions commented on Aug 14, 2021

    @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.

  10. locked as resolved and limited conversation to collaborators on Aug 14, 2021
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

    a: text inputEntering text in a text field or keyboard related problemsa: typographyText rendering, possibly libtxtengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions