8000 Inline box index is decided based on byte length rather than on glyphs/graphemes, offsetting where the box is laid out in the text · Issue #345 · linebender/parley · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Inline box index is decided based on byte length rather than on glyphs/graphemes, offsetting where the box is laid out in the text #345
Closed
@SmakoszJan

Description

@SmakoszJan

I don't really know how parley does text layouting, including inline box layouting, but when pushing inline boxes into Unicode text, they appear offset by a few letters. The amount of letters correlates directly to characters that take up extra bytes (the exact offset matches the total extra bytes). When inspecting parley's code i found that inline box index is decided based on current text length, which is counted in bytes. This does not appear to be taken into consideration later on, when deciding the position of the inline boxes. I unfortunately cannot provide a least example, but I can provide the visual proof:

Image

The entire string seen on the screenshot is a single piece of text. As seen above, the first Icon is not offset as it is not preceded by any special characters. The star icon, however, preceded by an "Ł" and "ó" becomes offset by 2 places (a space and a "C"). Here's the english version of the string for comparison:

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0