On 2/12/2014 11:49 AM, Patrick Walton wrote:
On 2/11/14 9:42 PM, Robert O'Callahan wrote:
Obtaining the list of platform fonts is incredibly
performance-sensitive. We have a gfxPlatformFontList object for this,
which caches the font list indefinitely. When the system notifies us of
a font list change, we rebuild our font list from scratch, but that's
very rare of course. The tricky part is how to build this list without
slowing down startup. The key thing is that we don't always need the
list. We can look up simple fonts by family name without having a
complete list of the platform fonts, and for each language we have a
list of default font names that have a good chance of supporting the
characters of that language; all that means we can render many pages
without needing the platform font list.

Aha. That last one is probably going to be the biggest win in Servo. Everything I've tested uses pretty standard fonts, so probably the other browsers aren't hitting the platform font list at all. Filed an issue:

https://github.com/mozilla/servo/issues/1677

One of the things I would like us to consider (in both Gecko and Servo) is to stop using any available platform fonts by default. We should keep a list of normal system fonts and only use those. If a site wishes to use other fonts, they can use web fonts to supply them. This would reduce font fingerprinting privacy attacks and at the same time eliminate the font enumeration paths at startup which are expensive.

--BDS

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

Reply via email to