On 2/11/14 8:04 PM, Jack Moffitt wrote:
* `CTFontCollectionCreateMatchingFontDescriptors` - constructs the query
used to ask the OS which fonts are available. This is ultimately called from
Servo `FontContext::get_resolved_font_for_style()`, called during frame
construction for text boxes.

* `CTFontManagerCopyAvailableFamilyNames` - gets the list of available
families from the OS. Called when we create the thread-local font context.
(There is one font context per frame construction thread.)

I think these we can stuff into an Arc and share. At some point the
system may get new fonts added, at which point we'll need to create
and pass new ones. It seems a little silly that we recalculate the
font list and all the font groups every time, but it's mostly that way
because we never had a reason to mess with it until now.

Need to check whether these are OS objects, and if so, whether they're thread safe on all platforms. Linux fontconfig in particular is particularly bad, as we've discovered. (You need a lock around the whole thing unless you have a *very* recent version, newer than the one in many distros.) :(

Patrick

_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to