From 1b24ee4d691f3b41195c92bbb9f2dde68487ea9d Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 10 Jun 2014 13:51:22 +0200 Subject: Remove 'font' shorthand if we have written out font longhand properties. (bzr r13341.1.57) --- src/desktop-style.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/desktop-style.cpp') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index 37f537cc5..f6347e5c0 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -211,11 +211,17 @@ sp_desktop_set_style(SPDesktop *desktop, SPCSSAttr *css, bool change, bool write for (GSList const *i = desktop->selection->itemList(); i != NULL; i = i->next) { - // If not text, don't apply text attributes (can a group have text attributes?) + // If not text, don't apply text attributes (can a group have text attributes? Yes! FIXME) if ( SP_IS_TEXT(i->data) || SP_IS_FLOWTEXT(i->data) || SP_IS_TSPAN(i->data) || SP_IS_TREF(i->data) || SP_IS_TEXTPATH(i->data) || SP_IS_FLOWDIV(i->data) || SP_IS_FLOWPARA(i->data) || SP_IS_FLOWTSPAN(i->data)) { + // If any font property has changed, then we have written out the font + // properties in longhand and we need to remove the 'font' shorthand. + if( !sp_repr_css_property_is_unset(css, "font-family") ) { + sp_repr_css_unset_property(css, "font"); + } + sp_desktop_apply_css_recursive(SP_OBJECT(i->data), css, true); } else { -- cgit v1.2.3 From a5e84125b62bf41871b57d93e457db81ee139485 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Mon, 18 Aug 2014 17:18:05 -0400 Subject: Fix build (not pretty). (bzr r13341.1.146) --- src/desktop-style.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'src/desktop-style.cpp') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index f6347e5c0..91359983b 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -14,6 +14,7 @@ #include #include +#include #include "desktop.h" #include "color-rgba.h" -- cgit v1.2.3 From 7fd4a3fa7436b7064cf55474ff53b76be1e2a7dc Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Tue, 23 Sep 2014 15:17:29 +0200 Subject: Fix for #1334792. Correct inheritance for 'line-height' property. (bzr r13341.1.217) --- src/desktop-style.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/desktop-style.cpp') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index 91359983b..2c20524a2 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -1012,8 +1012,8 @@ objects_query_fontnumbers (GSList *objects, SPStyle *style_res) } else if (style->line_height.unit == SP_CSS_UNIT_PERCENT || style->font_size.computed == 0) { linespacing_current = style->line_height.value; linespacing_normal = false; - } else { // we need % here - linespacing_current = style->line_height.computed / style->font_size.computed; + } else { + linespacing_current = style->line_height.computed; linespacing_normal = false; } linespacing += linespacing_current; -- cgit v1.2.3 From e186cf544131e582a43316767257f199e6af986c Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Mon, 29 Sep 2014 16:21:07 +0200 Subject: Remove NRTypePosDef class and associated cruft. More direct CSS -> Pango translation. (bzr r13341.1.233) --- src/desktop-style.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/desktop-style.cpp') diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp index 2c20524a2..ce8a06f29 100644 --- a/src/desktop-style.cpp +++ b/src/desktop-style.cpp @@ -41,7 +41,6 @@ #include "sp-tspan.h" #include "xml/repr.h" #include "xml/sp-css-attr.h" -#include "libnrtype/font-style-to-pos.h" #include "sp-path.h" #include "ui/tools/tool-base.h" @@ -1099,7 +1098,10 @@ objects_query_fontstyle (GSList *objects, SPStyle *style_res) texts ++; if (set && - font_style_to_pos(*style_res).signature() != font_style_to_pos(*style).signature() ) { + ( ( style_res->font_weight.computed != style->font_weight.computed ) || + ( style_res->font_style.computed != style->font_style.computed ) || + ( style_res->font_stretch.computed != style->font_stretch.computed ) || + ( style_res->font_variant.computed != style->font_variant.computed ) ) ) { different = true; // different styles } -- cgit v1.2.3