[webkit-dev] Fonts for WebKit tests on OS X?
fred.wang at free.fr
Tue Mar 15 04:03:18 PDT 2016
Le 14/03/2016 23:34, Myles C. Maxfield a écrit :
> This is because we whitelist an explicit list of fonts which the tests
> are allowed to use. We don’t want tests to start failing just because
> the user has some unexpected font installed on their system. See
> allowedFontFamilySet() in Tools/DumpRenderTree/mac/DumpRenderTree.mm,
> Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm, and
Yes, that's the files Darin pointed out in his message. I tried it and
it worked great, thanks.
> We call CTFontManagerRegisterFontsForURLs(…
> kCTFontManasgerScopeProcess …) to make the fonts look like they are
> installed for just the local process. On iOS, we use the -sectcreate
> linker flag to place the font data directly inside the DumpRenderTree
> binary. We then create an in-memory CGFontRef backed by these bytes
> (the loader will put them in memory for us at process creation) we use
> CTFontManagerRegisterGraphicsFont() to make it look like it is
> installed. See activateTestingFonts() and activateFontIOS() in
I verified the fonts in the repo used by OS X / iOS. As I see they are
duplicated in two places, their sizes are a few kilo bytes, they are
really test fonts (in the sense that they only have some artificial
glyphs and features) and no explicit license to restrict the usage (and
AHEM is in the public domain). I also see that fonts for specific
languages like "Corsiva Hebrew", "Devanagari MT" are in the whitelist so
I assume they are used for testing specific scripts.
So it seems that to be consistent with what is currently done, real open
source math fonts like Latin Modern Math and STIX Math would really go
into the list of allowedFontFamilySet but not in the WebKit repo. What
makes sense would be to put an artificial font in the repo to test math
features, but that's not so much different from the idea of using Web
fonts (and it is already done).
Anyway, for now I know how I can add custom fonts on iOS / OSX if that
turns out to be necessary or just for me to run tests locally ; and
Apple developers are aware of how to improve math rendering on their
ports. And as I said, I'll come back later on this math font topic when
more progress is made.
Thank you again.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: OpenPGP digital signature
More information about the webkit-dev