Skip to content

mapTextToFonts leaves the final font run length at zero #3779

Description

@dajiaohuang

FontMetrics::mapTextToFonts() does not set the length of its final font run. The loop updates length only when it encounters a transition to another font. After the loop, the last run therefore retains the initial value 0.

When called with returnSubstring: true, a string that maps entirely to one font returns a mapping with length: 0 and an empty text; when there are multiple runs, the final run likewise has length zero and an empty substring. This contradicts the method documentation that returns substring start/length/text information and can cause callers to omit or truncate the final run.

The earlier font mapping change in #3155 introduced this implementation; this report is about the missing final-run length update.

No runtime test was run for this report.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions