Image Glyph for Text Layout ? #3781
Replies: 1 comment 1 reply
-
No, this is not currently possible. The simplest thing for you to do is probably to use use I'm hesitant to complicate the text layout further. We're also considering replacing it with another text layout engine, and so whatever hack we add there won't work with another text layout engine. Have you considered setting up a custom TTF with the glyphs you need and use that? Alos, hae you checked out https://typst.app/ and https://github.com/mattfbacon/typst-egui ? |
Beta Was this translation helpful? Give feedback.
-
I'm coming from Dear ImGUI / C++, and only looked at this library for a couple of days. Sorry if I missed an already existing issue.
Is your feature request related to a problem? Please describe.
I want to render svg LaTeX equations inline in a Text Layout. In certain way, this LaTeX equation image has all the behavior as another text glyph: I have a baseline, ascent info, ... Would it be possible to add images to the layouter ?
Describe the solution you'd like
I would like to be able to append arbitrary images (along with text baseline infos) to a layout job (sorry, I'm not thinking about the borrow checker):
Describe alternatives you've considered
I could rewrite my own layouter (like I did for Dear ImGui in C++), but it would be a shame to not use the existing interface.
Or I could create my own 'fake' font texture, but I will have potentially hundreds of different LaTeX equations, that are only drawn once, and they could be updated at each keystroke. Not ideal rebuilding the font texture at each keystroke.
Additional context
Here is a demo of my implementation of this feature in Dear ImGUI (ignore some of the bugs, it is an old recording):
https://github.com/emilk/egui/assets/25845695/eaa1d412-1058-45ca-b73a-3d7ae2d92570
Thanks
Beta Was this translation helpful? Give feedback.
All reactions