From: tavmjong-free Date: Mon, 7 Jun 2010 10:49:12 +0000 (+0200) Subject: "Fix" for bug #583593 (Default tool styles are not loaded for new users). X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7667f11057fb068d894eb771ebf2f8653ea1835b;p=inkscape.git "Fix" for bug #583593 (Default tool styles are not loaded for new users). (Call sp_desktop_set_style() with write_current = false.) Tweak superscript/subscript shifts/sizes. --- diff --git a/src/style.cpp b/src/style.cpp index b3cc370f9..2b5804671 100644 --- a/src/style.cpp +++ b/src/style.cpp @@ -1370,12 +1370,12 @@ sp_style_merge_baseline_shift_from_parent(SPIBaselineShift &child, SPIBaselineSh child.computed = 0; // No change } else if (child.literal == SP_CSS_BASELINE_SHIFT_SUB ) { // Should use subscript position from font relative to alphabetic baseline - // In mean time use values from OpenOffice and Adobe - child.computed = -0.33 * pfont_size.computed; + // OpenOffice, Adobe: -0.33, Word -0.14, LaTex about -0.2. + child.computed = -0.2 * pfont_size.computed; } else if (child.literal == SP_CSS_BASELINE_SHIFT_SUPER ) { // Should use superscript position from font relative to alphabetic baseline - // In mean time use values from OpenOffice and Adobe - child.computed = 0.33 * pfont_size.computed; + // OpenOffice, Adobe: 0.33, Word 0.35, LaTex about 0.45. + child.computed = 0.4 * pfont_size.computed; } else { /* Illegal value */ } diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index 5079e4ffd..5950bf841 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -6676,8 +6676,11 @@ static void sp_text_script_changed( InkToggleAction* act, GObject *tbl ) // Set css properties SPCSSAttr *css = sp_repr_css_attr_new (); if( setSuper || setSub ) { - // Openoffice 2.3 and Adobe use 58%, Microsoft Word 2002 uses 65%. - sp_repr_css_set_property (css, "font-size", "58%"); + // Openoffice 2.3 and Adobe use 58%, Microsoft Word 2002 uses 65%, LaTex about 70%. + // 58% looks too small to me, especially if a superscript is placed on a superscript. + // If you make a change here, consider making a change to baseline-shift amount + // in style.cpp. + sp_repr_css_set_property (css, "font-size", "65%"); } else { sp_repr_css_set_property (css, "font-size", ""); } @@ -6691,7 +6694,7 @@ static void sp_text_script_changed( InkToggleAction* act, GObject *tbl ) // Apply css to selected objects. SPDesktop *desktop = SP_ACTIVE_DESKTOP; - sp_desktop_set_style (desktop, css, true, true); + sp_desktop_set_style (desktop, css, true, false); // Save for undo sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:script", SP_VERB_NONE, @@ -6864,7 +6867,7 @@ static void sp_text_lineheight_value_changed( GtkAdjustment *adj, GObject *tbl ) // Apply line-height to selected objects. SPDesktop *desktop = SP_ACTIVE_DESKTOP; - sp_desktop_set_style (desktop, css, true, true); + sp_desktop_set_style (desktop, css, true, false); // Until deprecated sodipodi:linespacing purged: @@ -6913,7 +6916,7 @@ static void sp_text_wordspacing_value_changed( GtkAdjustment *adj, GObject *tbl // Apply word-spacing to selected objects. SPDesktop *desktop = SP_ACTIVE_DESKTOP; - sp_desktop_set_style (desktop, css, true, true); + sp_desktop_set_style (desktop, css, true, false); // Save for undo sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:word-spacing", SP_VERB_NONE, @@ -6952,7 +6955,7 @@ static void sp_text_letterspacing_value_changed( GtkAdjustment *adj, GObject *tb // Apply letter-spacing to selected objects. SPDesktop *desktop = SP_ACTIVE_DESKTOP; - sp_desktop_set_style (desktop, css, true, true); + sp_desktop_set_style (desktop, css, true, false); // Save for undo sp_document_maybe_done (sp_desktop_document (SP_ACTIVE_DESKTOP), "ttb:letter-spacing", SP_VERB_NONE,