RESOLVED DUPLICATE of bug 42154 122851
Use unicode-range to prevent unnecessary @font-face donwnloads
https://bugs.webkit.org/show_bug.cgi?id=122851
Summary Use unicode-range to prevent unnecessary @font-face donwnloads
Ryosuke Niwa
Reported 2013-10-15 12:22:03 PDT
Consider merging https://chromium.googlesource.com/chromium/blink/+/342fe16bb002b8ba9cc06a10d8124df6a28c786f This patch delays font loading until creation of GlyphPage whose codepoint range intersects with the @font-face's unicode-range value. GlyphPage is created when glyph data for a character in its codepoint range is requested, so web fonts are not donwloaded if its glyph data is not used. Even if any glyph is not used, font metrics may be used (for example, <input> uses font metrics to calculate its size). These metrics are accessed via SimpleFontData::primarySimpleFontData, so we start loading there too. Caveat: Since GlyphPage has glyph data for contiguous 256 Unicode codepoints, this patch does not 100% prevent unnecessary downloads. Use of codepoint *near* the unicode-range can trigger the font load. To fix this, we need to delay font loading until a codepoint in unicode-range is requested. That may require changing the GlyphPage data structure.
Attachments
Myles C. Maxfield
Comment 2 2016-05-05 23:36:06 PDT
*** This bug has been marked as a duplicate of bug 42154 ***
Note You need to log in before you can comment on or make changes to this bug.