Code

"Fix" for bug #583593 (Default tool styles are not loaded for new users).
authortavmjong-free <tavmjong@free.fr>
Mon, 7 Jun 2010 10:49:12 +0000 (12:49 +0200)
committertavmjong-free <tavmjong@free.fr>
Mon, 7 Jun 2010 10:49:12 +0000 (12:49 +0200)
   (Call sp_desktop_set_style() with write_current = false.)
Tweak superscript/subscript shifts/sizes.

src/style.cpp
src/widgets/toolbox.cpp

index b3cc370f9cdb39cb97ac2ae212c5d63da7178dc4..2b5804671890d0a87f4869c7fc5c2fdfccfe381b 100644 (file)
@@ -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 */
         }
index 5079e4ffddf37601d3df0f8c6ee81a886f4a2a1d..5950bf8414f30b4d3f3d3cb20610265333ba65bc 100644 (file)
@@ -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,