[Commits] [wesnoth/wesnoth] cfb1f8: font: Provide our own fontconfig settings (bug #20...

GitHub noreply at github.com
Wed Aug 19 07:52:57 UTC 2015


  Branch: refs/heads/1.12
  Home:   https://github.com/wesnoth/wesnoth
  Commit: cfb1f8e098655d3a9d9dd96df5ee5f525e89d5fb
      https://github.com/wesnoth/wesnoth/commit/cfb1f8e098655d3a9d9dd96df5ee5f525e89d5fb
  Author: Ignacio R. Morelle <shadowm at wesnoth.org>
  Date:   2015-08-19 (Wed, 19 Aug 2015)

  Changed paths:
    M changelog
    A fonts/fonts.conf
    M players_changelog
    M src/font.cpp

  Log Message:
  -----------
  font: Provide our own fontconfig settings (bug #20337)

Due to an unfortunate combination of Cairo's use of premultiplied alpha
and our engine expecting to be able to blit pre-rasterized text surfaces
with an alpha channel into arbitrary surfaces, we can't safely use RGB
subpixel hinting without getting glyph color glitches. This is
particularly noticeable in GUI2 dialogs when the system fontconfig
settings dictate subpixel hinting to be enabled. Bug #21648 is just a
Windows-specific case of the same issue exacerbated by an as of yet
unaddressed peculiarity of Cairo's premultiplied alpha format on
Windows.

SDL_ttf avoids the issue entirely by always using an equivalent of
hintstyle=full and rgba=none with FreeType directly. There are very few
UI components in Wesnoth using SDL_ttf anymore, but they are still large
enough to make the rendering differences rather jarring (MP lobby,
preferences dialog, parts of the theme UI).

Our new custom fontconfig settings use hintstyle=full and rgba=none to
produce the same results with both SDL_ttf and Pango/Cairo render paths,
and eliminate the subpixel hinting glitches. This Works For Me™, but
fontconfig and Cairo generally seem unwilling to cooperate with me and
may produce different results on other systems.

It remains to be seen exactly how this patch impacts Apple OS X users
due to bugs #23560 and #23628. Windows users are unaffected and still
depend on the "fix" for #21648 because fontconfig is apparently disabled
for most intents and purposes on that particular platform (see also
commit cad8798d1add1abadad886d1a041c40d8c4f4f47).





More information about the Commits mailing list