diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2007-03-05 23:12:47 +0000 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2007-03-05 23:12:47 +0000 |
commit | 574c5ed8b0d4efc22bc980d1501d7358e3c58bfa (patch) | |
tree | f6ba64a70d4fa439c3e846548f71bd88de8851e2 /gtk2_ardour/utils.cc | |
parent | 62a96205de07d80ffa45fd31075dd9c98f0169ea (diff) |
get real Pango::FontDescriptions for several canvas items
git-svn-id: svn://localhost/ardour2/trunk@1557 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/utils.cc')
-rw-r--r-- | gtk2_ardour/utils.cc | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gtk2_ardour/utils.cc b/gtk2_ardour/utils.cc index 396940284b..fbebf0d51a 100644 --- a/gtk2_ardour/utils.cc +++ b/gtk2_ardour/utils.cc @@ -232,7 +232,21 @@ get_font_for_style (string widgetname) foobar.ensure_style(); style = foobar.get_style (); - return style->get_font(); + + Glib::RefPtr<const Pango::Layout> layout = foobar.get_layout(); + + PangoFontDescription *pfd = (PangoFontDescription *)pango_layout_get_font_description((PangoLayout *)layout->gobj()); + + if (!pfd) { + + /* layout inherited its font description from a PangoContext */ + + PangoContext* ctxt = (PangoContext*) pango_layout_get_context ((PangoLayout*) layout->gobj()); + pfd = pango_context_get_font_description (ctxt); + return Pango::FontDescription (pfd, true); /* make a copy */ + } + + return Pango::FontDescription (pfd, true); /* make a copy */ } uint32_t |