summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 0aa7c9a)
raw | patch | inline | side by side (parent: 0aa7c9a)
author | tavmjong-free <tavmjong@free.fr> | |
Thu, 15 Apr 2010 13:02:48 +0000 (15:02 +0200) | ||
committer | tavmjong-free <tavmjong@free.fr> | |
Thu, 15 Apr 2010 13:02:48 +0000 (15:02 +0200) |
src/desktop-style.cpp | patch | blob | history |
diff --git a/src/desktop-style.cpp b/src/desktop-style.cpp
index f3b1b833d8e8c778beac196502c8c3bcbc3a8bd1..2225be5ee6447cfc94c44939a97b67e711223c1a 100644 (file)
--- a/src/desktop-style.cpp
+++ b/src/desktop-style.cpp
double size = 0;
double letterspacing = 0;
+ double wordspacing = 0;
double linespacing = 0;
- bool linespacing_normal = false;
bool letterspacing_normal = false;
+ bool wordspacing_normal = false;
+ bool linespacing_normal = false;
double size_prev = 0;
double letterspacing_prev = 0;
+ double wordspacing_prev = 0;
double linespacing_prev = 0;
- /// \todo FIXME: add word spacing, kerns? rotates?
-
int texts = 0;
for (GSList const *i = objects; i != NULL; i = i->next) {
letterspacing_normal = false;
}
+ if (style->word_spacing.normal) {
+ if (!different && (wordspacing_prev == 0 || wordspacing_prev == wordspacing))
+ wordspacing_normal = true;
+ } else {
+ wordspacing += style->word_spacing.computed; /// \todo FIXME: we assume non-% units here
+ wordspacing_normal = false;
+ }
+
double linespacing_current;
if (style->line_height.normal) {
linespacing_current = Inkscape::Text::Layout::LINE_HEIGHT_NORMAL;
if ((size_prev != 0 && style->font_size.computed != size_prev) ||
(letterspacing_prev != 0 && style->letter_spacing.computed != letterspacing_prev) ||
+ (wordspacing_prev != 0 && style->word_spacing.computed != wordspacing_prev) ||
(linespacing_prev != 0 && linespacing_current != linespacing_prev)) {
different = true;
}
size_prev = style->font_size.computed;
letterspacing_prev = style->letter_spacing.computed;
+ wordspacing_prev = style->word_spacing.computed;
linespacing_prev = linespacing_current;
// FIXME: we must detect MULTIPLE_DIFFERENT for these too
if (texts > 1) {
size /= texts;
letterspacing /= texts;
+ wordspacing /= texts;
linespacing /= texts;
}
style_res->letter_spacing.normal = letterspacing_normal;
style_res->letter_spacing.computed = letterspacing;
+ style_res->word_spacing.normal = wordspacing_normal;
+ style_res->word_spacing.computed = wordspacing;
+
style_res->line_height.normal = linespacing_normal;
style_res->line_height.computed = linespacing;
style_res->line_height.value = linespacing;
for (GSList const *i = objects; i != NULL; i = i->next) {
SPObject *obj = SP_OBJECT (i->data);
+ // std::cout << " " << SP_OBJECT_ID (i->data) << std::endl;
if (!SP_IS_TEXT(obj) && !SP_IS_FLOWTEXT(obj)
&& !SP_IS_TSPAN(obj) && !SP_IS_TREF(obj) && !SP_IS_TEXTPATH(obj)
&& !SP_IS_FLOWDIV(obj) && !SP_IS_FLOWPARA(obj) && !SP_IS_FLOWTSPAN(obj))
for (GSList const *i = objects; i != NULL; i = i->next) {
SPObject *obj = SP_OBJECT (i->data);
+ // std::cout << " " << SP_OBJECT_ID (i->data) << std::endl;
if (!SP_IS_TEXT(obj) && !SP_IS_FLOWTEXT(obj)
&& !SP_IS_TSPAN(obj) && !SP_IS_TREF(obj) && !SP_IS_TEXTPATH(obj)
&& !SP_IS_FLOWDIV(obj) && !SP_IS_FLOWPARA(obj) && !SP_IS_FLOWTSPAN(obj))