summaryrefslogtreecommitdiffstats
path: root/src/libnrtype
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-07-04 00:48:30 +0000
committerJohn Smith <removethis.john.q.public@bigmail.com>2012-07-04 00:48:30 +0000
commit53fe022959ca3f120d07401366bb2a9e5618f262 (patch)
tree5aca33684699923382cf3ccd6a5c445f85f103fd /src/libnrtype
parentemf import. missing tick marks (Bug 715692) (diff)
downloadinkscape-53fe022959ca3f120d07401366bb2a9e5618f262.tar.gz
inkscape-53fe022959ca3f120d07401366bb2a9e5618f262.zip
Fix for 168658 : Font substitution warning dialog
(bzr r11522)
Diffstat (limited to 'src/libnrtype')
-rw-r--r--src/libnrtype/Layout-TNG-Output.cpp12
-rw-r--r--src/libnrtype/Layout-TNG.h3
2 files changed, 15 insertions, 0 deletions
diff --git a/src/libnrtype/Layout-TNG-Output.cpp b/src/libnrtype/Layout-TNG-Output.cpp
index 0ce00e43b..bf6516b42 100644
--- a/src/libnrtype/Layout-TNG-Output.cpp
+++ b/src/libnrtype/Layout-TNG-Output.cpp
@@ -340,6 +340,18 @@ static char const *weight_to_text(PangoWeight w)
return "???";
}
+Glib::ustring Layout::getFontFamily(unsigned span_index) const
+{
+ if (span_index < 0 || span_index >= _spans.size())
+ return "";
+
+ if (_spans[span_index].font) {
+ return pango_font_description_get_family(_spans[span_index].font->descr);
+ }
+
+ return "";
+}
+
Glib::ustring Layout::dumpAsText() const
{
Glib::ustring result;
diff --git a/src/libnrtype/Layout-TNG.h b/src/libnrtype/Layout-TNG.h
index 4406d9f93..f4a09f25b 100644
--- a/src/libnrtype/Layout-TNG.h
+++ b/src/libnrtype/Layout-TNG.h
@@ -353,6 +353,9 @@ public:
void showGlyphs(CairoRenderContext *ctx) const;
#endif
+ /** Returns the font family of the indexed span */
+ Glib::ustring getFontFamily(unsigned span_index) const;
+
/** debug and unit test method. Creates a textual representation of the
contents of this object. The output is designed to be both human-readable
and comprehensible when diffed with a known-good dump. */