1 # -*- Mode: Python; py-indent-offset: 4 -*-
2 # vim: tabstop=4 shiftwidth=4 expandtab
4 # Copyright (C) 2010 Paolo Borelli <pborelli@gnome.org>
6 # This library is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU Lesser General Public
8 # License as published by the Free Software Foundation; either
9 # version 2.1 of the License, or (at your option) any later version.
11 # This library is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 # Lesser General Public License for more details.
16 # You should have received a copy of the GNU Lesser General Public
17 # License along with this library; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
21 from ..overrides import override
22 from ..module import get_introspection_module
24 Pango = get_introspection_module('Pango')
29 class FontDescription(Pango.FontDescription):
31 def __new__(cls, string=None):
32 if string is not None:
33 return Pango.font_description_from_string(string)
35 return Pango.FontDescription.__new__(cls)
37 def __init__(self, *args, **kwargs):
38 return super(FontDescription, self).__init__()
40 FontDescription = override(FontDescription)
41 __all__.append('FontDescription')
44 class Layout(Pango.Layout):
46 def __new__(cls, context):
47 return Pango.Layout.new(context)
49 def set_markup(self, text, length=-1):
50 super(Layout, self).set_markup(text, length)
52 Layout = override(Layout)
53 __all__.append('Layout')