Changes between Version 1 and Version 2 of FontSelection
- Timestamp:
- Sep 5, 2015, 5:45:07 PM (9 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FontSelection
v1 v2 23 23 There 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. 24 24 25 [[Image(Fonts.png)]] 26 25 27 So that’s about half of the picture. The other half is about web fonts. 26 28 … … 40 42 41 43 Also 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)]] 42 46 43 47 == Extra considerations == … … 60 64 61 65 Literally each one of these steps is cached. 66 67 [[Image(Fonts 3.png)]] 68 69 (Orange means platform/ code)