go-text / typesetting

High quality text shaping in pure Go.
Other
100 stars 10 forks source link

Get the ID of the ligature glyph for a given string #131

Closed akiyosi closed 9 months ago

akiyosi commented 9 months ago

Is there a way to get the glyph ID of each character for a given string? Please note that I expect the glyph IDs here to be those to which the ligatures have been applied.

hajimehoshi commented 9 months ago

You can get an shaping.Output by a shaper like (&shaping.HarfbuzzShaper{}).Shape. An output includes shaping.Glyph, and this includes a glyph ID.

akiyosi commented 9 months ago

@hajimehoshi Thanks for the advice! I was able to get a list of glyph IDs to which the ligature was applied using the approach you gave me. This Issue is closed.