[mythtv-commits] mythtv commit: r23594 by mdean

mythtv at cvs.mythtv.org mythtv at cvs.mythtv.org
Wed Feb 24 07:41:33 UTC 2010


      Author: mdean
        Date: 2010-02-24 07:41:32 +0000 (Wed, 24 Feb 2010)
New Revision: 23594
   Changeset: http://svn.mythtv.org/trac/changeset/23594

Added:

   trunk/mythtv/libs/libmythui/mythfontmanager.cpp
   trunk/mythtv/libs/libmythui/mythfontmanager.h

Modified:

   trunk/mythtv/libs/libmythui/libmythui.pro
   trunk/mythtv/libs/libmythui/myththemebase.cpp

Log:

Since Qt4.2, Qt has supported loading fonts that are not installed on the system, so now we can load theme-provided fonts for UI themes.

This change adds a new class, MythFontManager, to manage font file loading and adds calls to ensure we scan theme directories for font files before loading the theme and that we unload no-longer-necessary font files when unloading the theme.

For themers, simply ensure you place (redistributable) TrueType font (.ttf), OpenType font (.otf), or TrueType font collection (.ttc) files anywhere within the theme directory structure, specify the font face within the theme XML as before, and the fonts will be used--whether they're installed on the system or not.  No changes to theme files are required.

Thanks to Chris Pinkham for tracking down the Qt QFontDatabase class and its ability to load application fonts--for providing the idea on which this patch is based.





More information about the mythtv-commits mailing list