Re: Cross hatch fills support in svg

Jan Aarsaether wrote:
> 
> I've been looking for a convenient way of specifying cross hatch
> patters on drawing primitive. While there is nice support for fill
> opacity and color, there seems to be little direct support for
> specifying something so commonly used as such patterns.

You have a correct example of how to do this in your example below

> The only way I see achieving this is would be something like this:
> 
>  <defs>
>   <pattern id="pattern2" x="0" y="0" width="30" height="30">
>    <path style="stroke:black" d="_whatevernecessary_"/>
>   </pattern>
>  </defs>
>  <g>
>   <rect x="0" y="0" width="832" height="896" style="fill:url(#pattern2);"/>
>  </g>

Yes, that is correct. Of course, the pattern can be defined in one file
and reused in others. If you define the pattern without an explicit
stroke color, then you can restyle each usage to be the color you want.
The example above will always use a black stroke, which may or may not
be what you want.

> But it seems weird that such common functionality is not supported in
> a more direct manner in svg. Please, tell me it is!!!!! 

Which fill patterns would you like? Would they be universally suitable,
or would other people want different ones? Looking at a specification
such as CGM, many of the post-standardisation registered extensions are
for slight variations on fill pattermns, some of which have defined
meanings in particular countries or particular vertical markets. Then
there is a problem of which implementations support which registered
extrensions.

So, we could either supply a small set which would not please the users,
or a large set which would not please the implementors and still not
please the users, or allow a distributed, decentralised, fully general
pattern facility. Which is why SVG was designed that way.

So if your particular application uses 50 particular patterns, you can
make an SVG file with those 50 patterns and put it on your web site and
anyone who wants to (for example, users of software that you write, etc)
can use those patterns. And you will know that any conforming SVG
vioewer will display them fine, even ones written before you came up
with your desired hatch patterns.


I would also, by the way, refer you to work on legibility and clarity
and the problems of high frequency detail - such as the classic works by
Tufte - and advise, for graphics to be presented online or on
color-capable print devices - the use of solid colors rather than fill
patterns where these are intended to convey measning and where you have
a free choice. hatch patterns are a workaround for low color availablity
on older printers and plotters.

--
Chris

Received on Thursday, 14 October 1999 07:25:31 UTC