Text question
Can I draw a unicode character without it's ascender and descenders?
Let's say I want to fill a Box {} with the letter
A
but I don't want any of the white space that is there for other letters.
In my real example I'm using unicode characters, all of which is of the same size, but I don't want the whitespace I'm getting
I.e. can I draw the glyph itself somehow.
y
yschimke
07/14/2025, 9:57 PM
Would TextMeasurer/TextLayoutResult work. Get the bounding box? Then draw via Canvas?
e
enighma
07/14/2025, 10:29 PM
The challenge is that when I measure it, I will get a smaller glyph than I want to. I could probably use that information and scale it, but in my case that would look pretty bad.
Right now I'm doing something really hacky and scale the graphics layer, but that can easily break.
I guess what I want exists but very far down in the graphics stack. However, sometimes there's an API 🙂
b
Bogdan Vladoiu Lbs
07/15/2025, 8:43 PM
the Paint() api in skia is what you are thinking of?