diff options
| author | Tavmjong Bah <tavmjong@free.fr> | 2019-10-01 10:37:50 +0000 |
|---|---|---|
| committer | Tavmjong Bah <tavmjong@free.fr> | 2019-10-01 10:37:50 +0000 |
| commit | a48a5301a4d8912d717dc6e393608b8abb55a086 (patch) | |
| tree | 9db87354f5c2e300b3765efc0d61f71ba694296e /src/libnrtype | |
| parent | Use two bounding box caches instead of one (diff) | |
| download | inkscape-a48a5301a4d8912d717dc6e393608b8abb55a086.tar.gz inkscape-a48a5301a4d8912d717dc6e393608b8abb55a086.zip | |
Support "lang" and "xml:lang" attributes.
Partial fix for https://gitlab.com/inkscape/inbox/issues/951
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/Layout-TNG-Compute.cpp | 8 | ||||
| -rw-r--r-- | src/libnrtype/Layout-TNG.h | 3 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/libnrtype/Layout-TNG-Compute.cpp b/src/libnrtype/Layout-TNG-Compute.cpp index 03ccc62d7..aad2744b5 100644 --- a/src/libnrtype/Layout-TNG-Compute.cpp +++ b/src/libnrtype/Layout-TNG-Compute.cpp @@ -1148,6 +1148,14 @@ void Layout::Calculator::_buildPangoItemizationForPara(ParagraphInfo *para) con pango_attr_list_insert(attributes_list, attribute_font_features); #endif + // Set language + SPObject * object = static_cast<SPObject *>(text_source->source_cookie); + if (!object->lang.empty()) { + PangoLanguage* language = pango_language_from_string(object->lang.c_str()); + PangoAttribute *attribute_language = pango_attr_language_new( language ); + pango_attr_list_insert(attributes_list, attribute_language); + } + // ownership of attribute is assumed by the list font->Unref(); } diff --git a/src/libnrtype/Layout-TNG.h b/src/libnrtype/Layout-TNG.h index 4f096abab..596e112b3 100644 --- a/src/libnrtype/Layout-TNG.h +++ b/src/libnrtype/Layout-TNG.h @@ -718,7 +718,8 @@ private: std::vector<SVGLength> rotate; SVGLength textLength; LengthAdjust lengthAdjust; - + Glib::ustring lang; + // a few functions for some of the more complicated style accesses /// The return value must be freed with pango_font_description_free() PangoFontDescription *styleGetFontDescription() const; |
