On 19-Jan-2014 06:28, Tavmjong Bah wrote:
A long-long-long awaited feature! I eagerly await being able to try
it
out.
To try it, apply this patch:
https://bugs.launchpad.net/inkscape/+bug/1269206
I am not sure that we should be including CSS3 text decorations at
this
point (at least in the GUI).
Mostly I went there because there was no other way to specify the text
decoration line styles wavy, dotted, and dashed. Additionally,
specifying color changes for the text decorations separately from the
text color is a pain to do using only CSS2 edits. It is possible, but
the operations go something like this:
1. enter "ATextA" and format it as blue, underlined
2. select "Text" and change the color to red.
3. Select the terminal "A" characters and delete them.
CSS3 text decoration also doesn't seem
to have been implemented by any of the browsers yet and the SVG WG
hasn't discussed how CSS3 text decoration will work in the context of
SVG2.
Yup. The specs are a little contradictory: what CSS wants and what SVG
wants are already somewhat at odds, and it will only get worse with CSS
3. The SVG spec says text-decoration should pick up both fill and
stroke whenever it sees a "text-decoration" style tag. Unfortunately,
CSS3 only has "text-decoration-color", when what is actually needed for
SVG, given the preceding, are the two tags "text-decoration-fill" and
"text-decoration-stroke". (Otherwise, what does text-decoration-color
refer to?) My present implementation punts on pretty much all of this.
It only decorates with a solid color, and it gets it from
1. explicit text-decoration-color (either of the two CSS 3 syntax's
for this)
2. from stroke (if stroke is defined)
3. from fill (if fill is defined)
The result looks about right for the cases I encounter, which are slides
from lectures for biology classes, but it is not correct according to
the SVG spec.
The problem is, to do it right, one needs in style.h not only "fill" and
"stroke", but also "text_decoration_fill" and
"text_decoration_stroke".
(Plus various associated values like width or opacity.) But there are
no standard SVG tags that correspond to any of these extra
"text_decoration_*". So I swept it all under the carpet and used just
"text-decoration-color" which is a tag in CSS3 by itself, and can be
combined in for the 3 value CSS3 "text-decoration" tag and saved in an
SVG file. Other browsers ignore
the extra two values, so it doesn't display right there. Presumably
this could be done with some type of "sodipodi:text-decoration-fill"
tag, but there is no way that will ever
be in SVG, and again, other browsers will just ignore it. So I think if
a fully SVG 1.1 compliant fill and stroke were implemented now in
Inkscape it would most likely have to be ripped out again later.
I also noticed that in nested tspans the "Text and Font dialog" does not
pick up the correct font size (or text decoration) in many cases. The
text tool that runs horizontally along the top gets the font size right
always, so they must do things differently. Example, enter as text
"12345678" and format the entire thing as Arial 32pt red fill. Then
select "234567" and make that 28 pt. Then select "3456" and change the
color to blue. Place the cursor between the "2" and "3", or select
"23"
and the text tool that runs along the top shows "28pt", but the "Text
and Font" dialog still shows "32pt". The same sort of thing happens
when text-decoration changes are made instead of font size changes.
Regards,
David Mathog
mathog@...1176...
Manager, Sequence Analysis Facility, Biology Division, Caltech