Version 4 (modified by 14 years ago) ( diff ) | ,
---|
The Font Backends
WebKitGTK+ currently supports two font backends: FreeType and Pango. This is somewhat of a misnomer, because even though the FreeType backend uses Fontconfig for selection and Freetype for reading font data / creating custom fonts, it still uses Pango (specifically PangoCairo) for complex text layout (WebCore/platform/graphics/gtk/FontGtk.cpp). Currently there are quite a few issues related to font layout and selection.
Goals
- Proper CSS font selection The CSS standard has a fairly rigorous algorithm for selecting the appropriate font for text. Instead of properly falling back according to the list of fonts in CSS, WebKitGTK+ lets Fontconfig or Pango to supply what it thinks is an appropriate replacement.
- Use HarfBuzz directly PangoCairo uses HarfBuzz internally, but switching away from PangoCairo has benefits. Behdad Esfahbod, author of HarfBuzz, also summarizes why it is best for browsers to use HarfBuzz directly: Firefox uses Pango. Firefox 2 was hacked to use PangoLayout API. That was very abusive and inherently inefficient. Firefox 3 has got a new layout engine that is completely based on cairo. The Linux port subclasses PangoFcFontMap to be able to support both CSS text selection as well as web fonts. By doing that it is essentially reimplementing most of Pango and only using the shaping logic. It makes much more sense to use HarfBuzz directly, and Mozilla is now working on getting HarfBuzz ready for that.
Additionally, using HarfBuzz directly will allow us to share layout and shaping code with Chromium.
- Remove the Pango backend Maintaining the Pango backend is a serious support burden and since we'll be using HarfBuzz to do layout and shaping, is very redundant. For GTK+ ports that do not want to depend on Fontconfig, there is the option of using native Win32 font selection. The WinCairo port is already using this.
Font Bugs
A collection of font-related bugs from Bugzilla:
- FontCustomPlatformData.cpp leaks FT_Faces
- Can't load some non-latin fonts with pango backend
- Downloadable fonts don't work with pango backend
- WebKit crashes when running acid3 on Linux using font backend Pango
- FontConfig leaks in FontCacheGtk
- Has inconsistent font selection behavior compared with other GTK2 apps
- Share complex text support with Chromium Linux
- Split FontPlatformData into FontPlatformDataGtk and FontPlatformDataPango
- Wrong font size calculated on google.com
- CSS font-style: italic behavior
- Wrong font instantiated from an unknown font family
- WebKit freetype backend doesn't support "locl" tables
- Fails to apply web fonts in some cases
- TypeKit (web) fonts not rendered
Note:
See TracWiki
for help on using the wiki.