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

[Feature request] drawTextRun method #17

@X-Ryl669

Description

@X-Ryl669

Currently, FastUIDraw is very low level concerning text rendering (which is a major requirement for a Canvas like API). It's storing a cache of Freetype's generated glyphs, and if I understand correctly, expect the user to provide the sequence of glyphs to render.

As a potential user of the library, the amount of work from "text" to glyph is a real nightmare to make right. One should take into account the language the text is in, the font's script to run to figure out which glyph to display at what position, and the glyph transformations. I'm not even speaking of font fallback when a glyph is missing in a font or a language.

The current best open source lifesaver is Harfbuzz that does the mapping from text run to glyphs run. However, having a working code with Harfbuzz is tricky, and I think it would be better if, instead of having all users implement their "something that work with harfbuzz but full of bug", the fastuidraw code implemented a working harfbuzz wrapper, so we could call rectangle Painter::draw_textRun(string, style, justification, double fontSize, rectangle src_rect) and also have a rectangle Painter::get_glyph_pos(string, style, justfication, double fontSize, size_t characterIndexInString) would be a real lifesaver and improve usability a lot.

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