GTK3 fix. Workaround for bug https://bugzilla.gnome.org/show_bug.cgi?id=679654 which prevents list_families() being called more than once to generate a list of fonts. Text reports and anything else which uses the PDF backend now works

svn: r20212
This commit is contained in:
Gary Burton
2012-08-14 21:58:29 +00:00
parent ea5dcfd4ae
commit aa1729d364
3 changed files with 48 additions and 16 deletions

@ -51,6 +51,7 @@ from gen.plug.report import utils as ReportUtils
from gen.errors import PluginError
from gen.plug.docbackend import CairoBackend
from gen.utils.image import resize_to_buffer
from gui.utils import SystemFonts
#------------------------------------------------------------------------
#
@ -108,9 +109,8 @@ def set_font_families():
"""
global font_families
##families = pango_context.list_families()
families = PangoCairo.font_map_get_default().list_families()
family_names = [family.get_name() for family in families]
fonts = SystemFonts()
family_names = fonts.get_system_fonts()
fam = [f for f in _TTF_FREEFONT.itervalues() if f in family_names]
if len(fam) == len(_TTF_FREEFONT):