New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make FontSystem
not self-referencing and update fontdb
and rustybuzz
#89
Conversation
Just a heads up: before version 0.13.0, lookups in |
FontSystem
not self-referencingFontSystem
not self-referencing and update fontdb
Ok, I have updated the |
FontSystem
not self-referencing and update fontdb
FontSystem
not self-referencing and update fontdb
and rustybuzz
I fixed the duplicate |
I've added |
@geieredgar I merged this since CI tests were passing but it appears to have drastically reduced the performance of the editor-test example, so I reverted. Please see if you can replicate this issue. |
@jackpot51 Yes, I could replicate this issue. The reason is that |
Thanks for looking into this. If there was a way to do what the swash Font does it would be ideal. |
This makes the
std
implementation ofFontSystem
not self-referencing, which in turn allows defining adb_mut
method for mutable access to the underlyingfontdb::Database
(requested in #75).The high level changes are:
FontKey
struct that stores thefontdb::ID
and (if theswash
feature is enabled) the swash key data(u32, swash::CacheKey)
.FontKey
can be obtained via the newFontSystem::get_font_key(id)
.FontKey
s are cached instead of cachingFont
s.FontSystem::get_font
now takes aFontKey
instead offontdb::ID
and creates aFont
on the fly, reusing the key data.FontMatches
.FontSystem::get_font_matches
now returns aArc<Vec<FontKey>>
instead ofArc<FontMatches<'a>>
.FontFallbackIter
borrowsfontdb::Database
and creates the font on the fly usingFont::from_key(db, key)
.