W3C home > Mailing lists > Public > public-fx@w3.org > January to March 2016

Re: [strokes] CSS fill/stroke spec + questions

From: Tavmjong Bah <tav.w3c@gmail.com>
Date: Fri, 29 Jan 2016 15:07:05 +0100
Message-ID: <1454076425.2562.76.camel@gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>, www-svg <www-svg@w3.org>
Cc: "public-fx@w3.org" <public-fx@w3.org>
On Mon, 2016-01-25 at 15:32 -0800, Tab Atkins Jr. wrote:
> Per an FXTF meeting some time ago
> <https://lists.w3.org/Archives/Public/www-style/2013Jun/0678.html>,
> fantasai and I have been drafting fill/stroke as applied to text in
> CSS, and with the extensions needed to handle multiline text,
> hierarchical elements, and multi-layer (background-like) paints.

I've added CSS Strokes as a topic for the joint CSS/SVG meeting. Here
are some quick comments:


  This property, although highly desired and simple in principle, turns
out to be quite difficult to define and implement. It has been moved
out of the SVG 2 specification into a "strokes" module (along with
'stroke-dashcorner' and 'stroke-dashadjust'). For some of the problems,


  It would also be nice to be able to give a numerical value to
partially offset a stroke.

  You might consider adding the 'paint-order' property as this solves
the common problem of distorted looking glyphs when stroke is above


  There are two additional values added in SVG 2:

    'miter-clip' (with a much nicer fallback behavior than 'miter').
    'arcs' (much more appealing join for curved paths).


  With the 'miter-clip' and 'arcs' line joins, a '<number>' value makes
more sense than an '<angle>' value. Computed value should be a number.


  Yes, percentages are stupid when referenced to the diagonal of the
containing block. Values in SVG can be lengths, percentages, or
numbers. Numbers are in user-units. Relative to stroke-width may seem
at first be an obvious choice but if stacking stroked path above each
other (with different widths to build complicated paths) then having it
in user-units makes sense.

  Interesting, the SVG spec does say "The ‘pathLength’ attribute on a
‘path’ element affects ‘stroke-dasharray’: each dash and gap length is
interpreted relative to the author's path length as specified by
‘pathLength’." What this actually means, I don't know... but it would
be quite handy to have percentages defined relative to path length (but
probably not very useful for stroking text).


  Same comments as for 'stroke-dasharray'.


> Currently this lives in the Text Decoration 4 ED
> <https://drafts.csswg.org/css-text-decor-4/>.  Is this appropriate,
> or
> should it live somewhere else less directly text-centric?
> We're also unsure exactly how much of fill/stroke to define in this
> spec.  Should we take over the entire model, copying text from SVG,
> or
> should we only define the syntax, and the rendering parts that are
> relevant to CSS, letting SVG define the rendering parts important to
> it?
> ~TJ
Received on Friday, 29 January 2016 14:07:43 UTC

This archive was generated by hypermail 2.3.1 : Friday, 29 January 2016 14:07:43 UTC