diff options
| author | David Mathog <> | 2013-06-19 17:20:33 +0000 |
|---|---|---|
| committer | ~suv <suv-sf@users.sourceforge.net> | 2013-06-19 17:20:33 +0000 |
| commit | d19db89e2e22d4e09c539bd42823d511aebb669f (patch) | |
| tree | f5322f76b16b0e4c97895ce2b805ea7375e44142 /src/style.h | |
| parent | merge from trunk (r12337) (diff) | |
| download | inkscape-d19db89e2e22d4e09c539bd42823d511aebb669f.tar.gz inkscape-d19db89e2e22d4e09c539bd42823d511aebb669f.zip | |
changes_2013_05_22a.patch:
1. Resolves issue of bug #988601 message 170 (Support of 'Unset' styles in EMF export).
2. Implements CSS 3 (and CSS 2) text-decoration support.
Note that it does not yet provide any method of adding these features - at present it just shows whatever is in the SVG. This new code is also used to display EMF/WMF strike-through and underline text decorations when these files are read in. Those decorations may also be written out to EMF/WMF. Other text decoration features, like overline, or dotted lines, are dropped. For SVG text-decoration -line, -style, -color are all implemented. CSS3 provides two ways to represent the same state, this code uses the compound text-decoration method rather than the 3 fields method. Also it leaves out keywords that are not needed and would break backwards compatibility. For instance:
text-decoration: underline solid
is valid, but would break CSS2. Solid is the default, so that sort of case is written as:
text-decoration: underline
If the state is CSS3 specific all of the needed fields are of course include, like
text-decoration: underline wavy red
3. It incorporates the fix for bug 1181326 (Text edit mishandles span of just colored spaces)
4. It incorporates further changes to text editing so that style can be changed on spans consisting of only spaces when text decorations are present in the span.
5. It incorporates code to disable text decorations when text so marked is mapped onto a path.
6. Fixed more bugs in Hebrew language support than I can remember. Hebrew language export/import to EMF now works quite well. (See the examples in libTERE v 0.7.) WMF does not support unicode and for all intents and purposes Inkscape has no way to read or write Hebrew to it. Some of more important things that now work that didn't (or didn't always): Hebrew diacritical marks, R/L/center justification, and bidirectional text. The Hebrew fonts "Ezra SIL" and "EZRA SIL SR" should be installed before viewing the libTERE examples, otherwise font substitutions will cause some text shifts.
7. Implemented font failover in Text Reassemble, which makes the process more robust. (Again, see the examples in libTERE. )
(bzr r11668.1.71)
Diffstat (limited to 'src/style.h')
| -rw-r--r-- | src/style.h | 44 |
1 files changed, 41 insertions, 3 deletions
diff --git a/src/style.h b/src/style.h index 0639c7402..c992e9dd2 100644 --- a/src/style.h +++ b/src/style.h @@ -229,8 +229,9 @@ struct SPIBaselineShift { float computed; }; +// CSS 2. Changes in CSS 3, where description is for TextDecorationLine, NOT TextDecoration /// Text decoration type internal to SPStyle. -struct SPITextDecoration { +struct SPITextDecorationLine { unsigned set : 1; unsigned inherit : 1; unsigned underline : 1; @@ -239,6 +240,18 @@ struct SPITextDecoration { unsigned blink : 1; // "Conforming user agents are not required to support this value." yay! }; +// CSS3 2.2 +/// Text decoration style type internal to SPStyle. +struct SPITextDecorationStyle { + unsigned set : 1; + unsigned inherit : 1; + unsigned solid : 1; + unsigned isdouble : 1; // cannot use "double" as it is a reserved keyword + unsigned dotted : 1; + unsigned dashed : 1; + unsigned wavy : 1; +}; + /// Extended length type internal to SPStyle. struct SPILengthOrNormal { unsigned set : 1; @@ -249,6 +262,21 @@ struct SPILengthOrNormal { float computed; }; +// These are used to implement text_decoration. The values are not saved to or read from SVG file +struct SPITextDecorationData { + float phase_length; // length along text line,used for phase for dot/dash/wavy + bool tspan_line_start; // is first span on a line + bool tspan_line_end; // is last span on a line + float tspan_width; // from libnrtype, when it calculates spans + float ascender; // the rest from tspan's font + float descender; + float line_gap; + float underline_thickness; + float underline_position; + float line_through_thickness; + float line_through_position; +}; + struct SPTextStyle; /// Stroke dash details. @@ -289,8 +317,18 @@ struct SPStyle { SPILength text_indent; /** text alignment (css2 16.2) (not to be confused with text-anchor) */ SPIEnum text_align; - /** text decoration (css2 16.3.1) */ - SPITextDecoration text_decoration; + /** text decoration (css2 16.3.1) is now handled as a subset of css3 2.4 */ + // SPITextDecoration text_decoration; + + /** CSS 3 2.1, 2.2, 2.3 */ + /** Not done yet, test_decoration3 = css3 2.4*/ + SPITextDecorationLine text_decoration_line; + SPIPaint text_decoration_color; + SPITextDecorationStyle text_decoration_style; + + // used to implement text_decoration, not saved to or read from SVG file + SPITextDecorationData text_decoration_data; + // 16.3.2 is text-shadow. That's complicated. /** Line spacing (css2 10.8.1) */ SPILengthOrNormal line_height; |
