diff options
Diffstat (limited to 'src/libnrtype')
| -rw-r--r-- | src/libnrtype/FontFactory.cpp | 10 | ||||
| -rw-r--r-- | src/libnrtype/Layout-TNG-Input.cpp | 5 | ||||
| -rw-r--r-- | src/libnrtype/Layout-TNG.h | 2 | ||||
| -rw-r--r-- | src/libnrtype/font-lister.cpp | 14 | ||||
| -rw-r--r-- | src/libnrtype/font-lister.h | 2 | ||||
| -rw-r--r-- | src/libnrtype/font-style-to-pos.h | 2 |
6 files changed, 17 insertions, 18 deletions
diff --git a/src/libnrtype/FontFactory.cpp b/src/libnrtype/FontFactory.cpp index 7c0b4ffba..4ae408397 100644 --- a/src/libnrtype/FontFactory.cpp +++ b/src/libnrtype/FontFactory.cpp @@ -825,17 +825,17 @@ font_instance* font_factory::FaceFromStyle(SPStyle const *style) if (style) { // First try to use the font specification if it is set - if (style->text->font_specification.set - && style->text->font_specification.value - && *style->text->font_specification.value) { + if (style->font_specification.set + && style->font_specification.value + && *style->font_specification.value) { - font = FaceFromFontSpecification(style->text->font_specification.value); + font = FaceFromFontSpecification(style->font_specification.value); } // If that failed, try using the CSS information in the style if (!font) { - font = Face(style->text->font_family.value, font_style_to_pos(*style)); + font = Face(style->font_family.value, font_style_to_pos(*style)); // That was a hatchet job... so we need to check if this font exists!! Glib::ustring fontSpec = font_factory::Default()->ConstructFontSpecification(font); diff --git a/src/libnrtype/Layout-TNG-Input.cpp b/src/libnrtype/Layout-TNG-Input.cpp index cb3e6f620..fa1e8c11b 100644 --- a/src/libnrtype/Layout-TNG-Input.cpp +++ b/src/libnrtype/Layout-TNG-Input.cpp @@ -286,16 +286,15 @@ font_instance *Layout::InputStreamTextSource::styleGetFontInstance() const PangoFontDescription *Layout::InputStreamTextSource::styleGetFontDescription() const { - if (style->text == NULL) return NULL; PangoFontDescription *descr = pango_font_description_new(); // Pango can't cope with spaces before or after the commas - let's remove them. // this code is not exactly unicode-safe, but it's similar to what's done in // pango, so it's not the limiting factor Glib::ustring family; - if (style->text->font_family.value == NULL) { + if (style->font_family.value == NULL) { family = "sans-serif"; } else { - gchar **families = g_strsplit(style->text->font_family.value, ",", -1); + gchar **families = g_strsplit(style->font_family.value, ",", -1); if (families) { for (gchar **f = families ; *f ; ++f) { g_strstrip(*f); diff --git a/src/libnrtype/Layout-TNG.h b/src/libnrtype/Layout-TNG.h index c3ccbffb5..efb5ebc24 100644 --- a/src/libnrtype/Layout-TNG.h +++ b/src/libnrtype/Layout-TNG.h @@ -34,7 +34,7 @@ namespace Inkscape { using Inkscape::Extension::Internal::CairoRenderContext; #endif -struct SPStyle; +class SPStyle; class Shape; struct SPPrintContext; class SVGLength; diff --git a/src/libnrtype/font-lister.cpp b/src/libnrtype/font-lister.cpp index dde0ee4a9..98589d9d7 100644 --- a/src/libnrtype/font-lister.cpp +++ b/src/libnrtype/font-lister.cpp @@ -358,8 +358,8 @@ namespace Inkscape sp_desktop_query_style (SP_ACTIVE_DESKTOP, query, QUERY_STYLE_PROPERTY_FONT_SPECIFICATION); //std::cout << " Attempting selected style" << std::endl; - if( result != QUERY_STYLE_NOTHING && query->text->font_specification.set ) { - fontspec = query->text->font_specification.value; + if( result != QUERY_STYLE_NOTHING && query->font_specification.set ) { + fontspec = query->font_specification.value; //std::cout << " fontspec from query :" << fontspec << ":" << std::endl; } @@ -693,15 +693,15 @@ std::pair<Glib::ustring, Glib::ustring> FontLister::new_font_family (Glib::ustri if (style) { // First try to use the font specification if it is set - if (style->text->font_specification.set - && style->text->font_specification.value - && *style->text->font_specification.value) { + if (style->font_specification.set + && style->font_specification.value + && *style->font_specification.value) { - fontspec = style->text->font_specification.value; + fontspec = style->font_specification.value; } else { - fontspec = style->text->font_family.value; + fontspec = style->font_family.value; fontspec += ","; switch (style->font_weight.computed) { diff --git a/src/libnrtype/font-lister.h b/src/libnrtype/font-lister.h index c42bf98fd..a460388d3 100644 --- a/src/libnrtype/font-lister.h +++ b/src/libnrtype/font-lister.h @@ -26,7 +26,7 @@ class SPObject; class SPDocument; class SPCSSAttr; -struct SPStyle; +class SPStyle; namespace Inkscape { diff --git a/src/libnrtype/font-style-to-pos.h b/src/libnrtype/font-style-to-pos.h index 56eb391c2..41ba6cf72 100644 --- a/src/libnrtype/font-style-to-pos.h +++ b/src/libnrtype/font-style-to-pos.h @@ -3,7 +3,7 @@ #include <libnrtype/nr-type-pos-def.h> -struct SPStyle; +class SPStyle; NRTypePosDef font_style_to_pos(SPStyle const &style); |
