CachedFont.cpp currently supports custom fonts for the CG and QT ports. We need to add support for this too.
This is easy enough to do with FreeType but I heard Pango doesn't provide appropriate API.
The relevant commit adding support to WebCore: http://trac.webkit.org/projects/webkit/changeset/26484 Some code I wrote about a year ago in another project to load TTFs straight from memory with FreeType: http://git.ndesk.org/?p=ndesk-xps;a=blob;f=src/FreeType.cs;h=f84f067c466843521b9548aa58496e2fa7ac12e6;hb=HEAD
Created attachment 18367 [details] Add support for downloadable fonts
>+ // We force antialiasing and disable hinting to provide consistent >+ // typographic qualities for custom fonts on all platforms. >+ cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE); >+ cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY); Is this what other ports do for antialiasing? I'm wondering if with a lcd screen and subpixel aliasing active, having gray antialiased webfonts side by side with subpixel antialiased ones may look odd.
(In reply to comment #4) > >+ // We force antialiasing and disable hinting to provide consistent > >+ // typographic qualities for custom fonts on all platforms. > >+ cairo_font_options_set_hint_style(options, CAIRO_HINT_STYLE_NONE); > >+ cairo_font_options_set_antialias(options, CAIRO_ANTIALIAS_GRAY); > > Is this what other ports do for antialiasing? > I'm wondering if with a lcd screen and subpixel aliasing active, having gray > antialiased webfonts side by side with subpixel antialiased ones may look odd. > I can't see any easy way to do this with the current font code. It's a good point though and is related to bug #16715, so we can add a TODO here.
Comment on attachment 18367 [details] Add support for downloadable fonts This looks good to me. Can we just remove those ifdefs now that Mac, Win, CG and GTK all support custom fonts? I think we can...
(In reply to comment #6) > (From update of attachment 18367 [details] [edit]) > This looks good to me. Can we just remove those ifdefs now that Mac, Win, CG > and GTK all support custom fonts? I think we can... > There's still WX I think. Might be an idea to make the feature opt-out though. Best done separately. Patch landed in r29418 (with a leak-fix spotted by bdash).