Closed M-Adoo closed 4 years ago
Yep that is expected. See layout/CHANGELOG.md. I've now also included this in glyph_brush's changelog (c3ef50b3ec14ac22bf9ea8bac3cd69a149c60974).
Thank you for your quick response,it's seems there isn's public api to know if a glyph will drawable ? I want know how many glyphs will be drawn.
That isn't provided by glyph_brush no. In general a glyph is drawable if it has an outline, so outlining the glyph determines this, which isn't super cheap (part of the reason it's no longer used to layout text).
You could:
It's technically possible that after running cache_queued
glyph_brush could have something like brush.was_cached(font_id: FontId, glyph: &Glyph) -> bool
method. false meaning either it wasn't queued at all, or it's a glyph that's invisible. This would be pretty fast. Would that be helpful?
Yes, brush.was_cached
is what I want.
Cool let me know if #113 looks ok to you. I went with ~is_cached
~ is_draw_cached
, as it seemed better.
Great! It's work for me.
I try to use glyphs to get how many char will be drawable, but found invisible glyphs also returned. Does this is a bug, or that is what your expect ?
Get count 17, not 14.