Supporting CSS2 custom fonts will be a great challenge since the Font in QtWebKit are very different from other ports. This is due to the lack of glyph level API from Qt, which will is also preventing QtWebKit from passing Acid 3.
Created attachment 21859 [details]
In this hack, I was able to use the code that is already in place to get the Custom Font loaded. This patch is an hack for many reasons:
- All fonts are loaded wether they are needed or not
- It by passes all the Font classes
- It shortcuts the notifying
Still, you can experience Custom Fonts with this patch.
A problem that will soon araise, is that once the font is loading into the QFontDatabase, only the family name from the .ttf file is actually available. So if the CSS profices a different font-face name, QtWebKit won't be able to make the link between the given name and the actual name of the font.
Use of QFont::insertSubstitution should come over that issue, although you don't have access to both names anywhere in the code right now.
A quick look at other ports give us there pseudo call stack:
On page rendering:
which will trigger the font request, and it will be downloaded
Once it is downloaded,
which will relayout the page using the new downloaded font.
With the recent font work the mentioned examples started to work.