summaryrefslogtreecommitdiffstats
path: root/src/style.h
diff options
context:
space:
mode:
authorTavmjong Bah <tavmjong@free.fr>2010-06-04 19:41:52 +0000
committertavmjong-free <tavmjong@free.fr>2010-06-04 19:41:52 +0000
commit763ecf36ae7377cd9c1fadefbe0c4c24b37a3ab0 (patch)
treee6d6e2b84f4908b778a9380f6624c523fb79da41 /src/style.h
parentAbout screen. Screen folder cleanup (0.47 screens removed). (diff)
downloadinkscape-763ecf36ae7377cd9c1fadefbe0c4c24b37a3ab0.tar.gz
inkscape-763ecf36ae7377cd9c1fadefbe0c4c24b37a3ab0.zip
Add support for baseline-shift attribute (all possible values).
Add superscript and subscript support to Text toolbar. Missing icons for superscript and subscript. Known bug: adding a character to a superscript or subscript text string resets baseline-shift attribute. (bzr r9475)
Diffstat (limited to 'src/style.h')
-rw-r--r--src/style.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/style.h b/src/style.h
index f1b5ec534..02ef41bf8 100644
--- a/src/style.h
+++ b/src/style.h
@@ -43,6 +43,7 @@ class SPIString;
class SPILength;
class SPIPaint;
class SPIFontSize;
+class SPIBaselineShift;
/// Float type internal to SPStyle.
struct SPIFloat {
@@ -190,6 +191,12 @@ enum {
SP_FONT_SIZE_PERCENTAGE
};
+enum {
+ SP_BASELINE_SHIFT_LITERAL,
+ SP_BASELINE_SHIFT_LENGTH,
+ SP_BASELINE_SHIFT_PERCENTAGE
+};
+
#define SP_FONT_SIZE ((1 << 24) - 1)
#define SP_F8_16_TO_FLOAT(v) ((gdouble) (v) / (1 << 16))
@@ -208,6 +215,17 @@ struct SPIFontSize {
float computed;
};
+/// Baseline shift type internal to SPStyle.
+struct SPIBaselineShift {
+ unsigned set : 1;
+ unsigned inherit : 1;
+ unsigned type : 2;
+ unsigned unit : 4;
+ unsigned literal: 2;
+ float value; // Can be negative
+ float computed;
+};
+
/// Text decoration type internal to SPStyle.
struct SPITextDecoration {
unsigned set : 1;
@@ -287,6 +305,8 @@ struct SPStyle {
SPIEnum block_progression;
/** Writing mode (css3 text 3.2 and svg1.1 10.7.2) */
SPIEnum writing_mode;
+ /** Baseline shift (svg1.1 10.9.2) */
+ SPIBaselineShift baseline_shift;
/* SVG */
/** Anchor of the text (svg1.1 10.9.1) */
@@ -500,6 +520,12 @@ enum SPTextAnchor {
SP_CSS_TEXT_ANCHOR_END
};
+enum SPCSSBaselineShift {
+ SP_CSS_BASELINE_SHIFT_BASELINE,
+ SP_CSS_BASELINE_SHIFT_SUB,
+ SP_CSS_BASELINE_SHIFT_SUPER
+};
+
enum SPVisibility {
SP_CSS_VISIBILITY_HIDDEN,
SP_CSS_VISIBILITY_COLLAPSE,