You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to retrieve something similar to DirectWrite's DWRITE_LINE_METRICS from glyph_brush_layout in addition to the actual glyph positions. This would allow us to more easily position inline content within the text, for example, a cursor for a text entry box. Right now, any inline content requires modifying the returned layout to make room for your cursor, and positioning the cursor for text input vertically is impossible.
The text was updated successfully, but these errors were encountered:
With the returned Vec<SectionGlyph> you have positions of each glyph & the section-byte index for the char.
So if you know your cursor's section-byte index you can find a position to draw it. You can also infer various line metrics from same-y glyphs.
I wouldn't normally imagine moving the layout around to make room for a cursor, don't they usually just go between the glyphs? Custom inline non-glyph content, like a arbitrary rect, is not currently supported but I imagine could be added.
I guess this is just aggregating glyph metrics like ascent and descent across SectionGlyphs for each line. ab_glyph's ScaleFont has the metrics I was looking for, which I should be able to combine with SectionGlyph to calculate the line metrics on my own.
It would be nice to be able to retrieve something similar to DirectWrite's
DWRITE_LINE_METRICS
fromglyph_brush_layout
in addition to the actual glyph positions. This would allow us to more easily position inline content within the text, for example, a cursor for a text entry box. Right now, any inline content requires modifying the returned layout to make room for your cursor, and positioning the cursor for text input vertically is impossible.The text was updated successfully, but these errors were encountered: