Changes between Version 1 and Version 2 of FontSelection


Ignore:
Timestamp:
Sep 5, 2015 5:45:07 PM (9 years ago)
Author:
mmaxfield@apple.com
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FontSelection

    v1 v2  
    2323There is also a singleton data structure called FontCache. All font lookups for preinstalled fonts go through this object at the lowest level. The API for FontCache produces Font objects, and internally it does this by using two caches: One for FontPlatformData objects, and one for Font objects. When a FontPlatformData cache miss occurs, this object knows how to (finally) create platform-dependent font objects, and construct a FontPlatformData out of them. If you’re looking for CTFontCreate*(), this is where you’ll find it.
    2424
     25[[Image(Fonts.png)]]
     26
    2527So that’s about half of the picture. The other half is about web fonts.
    2628
     
    4042
    4143Also note that, because of lifecycle issues explained below, the FontCascadeFonts object holds a reference to the CSSFontSelector. However, FontCascadeFonts is inside platform/, and nothing inside platform/ is supposed to know about anything outside of platform/. The way this is done is by having an abstract FontSelector interface inside platform/ which CSSFontSelector implements (and there are no other implementing classes). The FontSelector reference inside FontFascadeFonts is populated at construction time.
     44
     45[[Image(Fonts 2.png)]]
    4246
    4347== Extra considerations ==
     
    6064
    6165Literally each one of these steps is cached.
     66
     67[[Image(Fonts 3.png)]]
     68
     69(Orange means platform/ code)