On 2/10/14 12:41 PM, Robert O'Callahan wrote:
What exactly do you mean by "font collection loading"? If you ask the right
questions I can explain how it works in Gecko :-).

Sure thing. Sorry for the delay here, I needed to profile and re-familiarize myself with Servo's code :)

I'm on a Mac, so I'll describe it in terms of those APIs. The hot font-related functions in Wikipedia flow construction are as follows:

* `CTFontGetBoundingBox` - called during frame construction for text boxes when we hit a font we haven't seen yet. I think this is for vertical align.

* `CTFontGetAdvancesForGlyphs`/`CTFontGetGlyphsForCharacters` - core shaping functions, called during text run construction, part of frame construction, as part of a HarfBuzz callback.

* `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.)

So I guess my question is: Where does Gecko call the analogues to these functions?

Patrick

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

Reply via email to