alexheretic / glyph-brush

Fast GPU cached text rendering
Apache License 2.0
673 stars 52 forks source link

Custom elements #146

Closed FredrikNoren closed 2 years ago

FredrikNoren commented 2 years ago

Hi,

Amazing library first of all!

I have one question though; is it possible to incorporate custom elements into a text flow with this? Say for instance I wanted an inline image or custom element in a Section? (I don't need glyph-brush to render these things for me, just to make space in the text-layout and tell me where they should fit)

alexheretic commented 2 years ago

Hello, the default layout logic cannot handle this. It only supports glyphs with metrics from (potentially multiple) fonts positioned in a quad.

A custom GlyphPositioner could be used to allow such functionality while allowing _glyphbrush to continue caching the positions and rendering. However, this wouldn't be trivial to implement.

FredrikNoren commented 2 years ago

@alexheretic Alright, thanks!