summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6c8b964)
raw | patch | inline | side by side (parent: 6c8b964)
author | tavmjong-free <tavmjong@free.fr> | |
Mon, 7 Jun 2010 10:49:12 +0000 (12:49 +0200) | ||
committer | tavmjong-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.
Tweak superscript/subscript shifts/sizes.
src/style.cpp | patch | blob | history | |
src/widgets/toolbox.cpp | patch | blob | history |
diff --git a/src/style.cpp b/src/style.cpp
index b3cc370f9cdb39cb97ac2ae212c5d63da7178dc4..2b5804671890d0a87f4869c7fc5c2fdfccfe381b 100644 (file)
--- 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 */
}
index 5079e4ffddf37601d3df0f8c6ee81a886f4a2a1d..5950bf8414f30b4d3f3d3cb20610265333ba65bc 100644 (file)
--- a/src/widgets/toolbox.cpp
+++ b/src/widgets/toolbox.cpp
// 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", "");
}
// 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,