| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 2 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 | ||
| 4 个月前 |
Font Access API
This directory contains the browser-side implementation of Font Access API.
Related directories
//third_party/blink/renderer/modules/font_access/
contains the renderer-side implementation, and
//third_party/blink/public/mojom/font_access
contains the mojom interface for this API.
Code map
It consists of the following parts:
-
FontAccessManager:content::FontAccessManagerimplementsblink::mojom::FontAccessManager, providing a way to enumerate local fonts. It checks for the requirements to access local fonts such as user permission, page visibility and transient user activation. Once all the requirements are met, it returns the fonts data fromFontEnumerationCache. In terms of code ownership, there is oneFontAccessManagerperStoragePartitionImpl;Frames are bound toFontAccessManagervia aBindingContext. -
FontEnumerationCache:content::FontEnumerationCacheis a cache-like object that memoizes the data about locally installed fonts as well as the operation status, given the user locale. The data is read viacontent::FontEnumerationDataSource.GetFonts()and is stored and served inReadOnlySharedMemoryRegion. This class is not thread-safe. Each instance must be accessed from a single sequence, which must allow blocking. -
FontEnumerationDataSource:content::FontEnumerationDataSource, inherited by OS-specific subclasses, reads locally installed fonts from the underlying OS. While the subclasses of this class contains the implementation for reading font data, this class itself does not, as it is instantiated for non-supported OS. It is not thread-safe; all methods except for the constructor must be used on the same sequence, and the sequence must allow blocking I/O operations.