Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Better line-breaking support for bidirectional text #7112

Closed

Description

@ChrisLoer

Our current line-breaking algorithm has a naive approach to handling text that isn't fully Left-to-Right: if the "base" direction of a label is Right-to-Left instead of LTR, it breaks lines upwards instead of downwards. This is broken two ways:

  • If a label starts with RTL text but contains an embedded LTR string with a line break, the two LTR lines will appear in the opposite of the expected order.
  • If a label with multiple lines of RTL text also has an icon, the RTL text can overlay the icon.

The fix is to break our application of the bidirectional algorithm and Arabic shaping into two passes. In the first pass, we perform bidirectional layout and shaping on the entire label as one line. After performing shaping, we go through the line to choose line break points. On the second pass, we reapply the bidirectional algorithm with the line break points pre-set in order to get the correct behavior for line breaks of embedded LTR/RTL text.

Activity

  1. self-assigned this
    on Nov 17, 2016
  2. added
    Core
    on Nov 19, 2016
  3. changed the title [-][core] Better line-breaking support for bidirectional text[/-] [+]Better line-breaking support for bidirectional text[/+] on Nov 19, 2016
  4. ChrisLoer commented on Nov 30, 2016

    @ChrisLoer
    ContributorAuthor

    Closed with #7123

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Coretext rendering

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions