[Qgis-developer] Default fill/outline color for svg symbols

Nyall Dawson nyall.dawson at gmail.com
Sat Oct 10 23:04:15 PDT 2015


On 11 October 2015 at 01:21, Andreas Neumann <a.neumann at carto.net> wrote:
> Hi Nyall,
>
> Thank you for having a look at the SVG symbol issues.
>
> The SVG specification is very clear about what the default stroke and fill
> color is. See http://www.w3.org/TR/SVG/painting.html#FillProperties
>
> The default fill is black and the default stroke is "none" (no stroke).
>
> Let's not invent something new, if the SVG spec is unambiguous.
>
> If someone wants a white fill by default he could set the fill to
>
> fill="param(fill) white"
>
> Where white would be taken as default whereas in the case of
>
> fill="param(fill)" black should be the default according to the SVG spec.
>
> Note that the param() notation is not yet part of the SVG specification -
> there is only a proposal at http://www.w3.org/TR/SVGParamPrimer/ - which
> unfortunately never make it to a recommendation and was never implemented by
> the browsers. The most likely way to get this into browsers is through CSS -
> these days ... It would then not only work in SVG, but also in HTML or other
> web standards.

I think you've misinterpreted my proposal - I'm not talking about
modifying SVG files, I'm referring exclusively to these params. So I'm
proposing altering all the svg files that QGIS ships with to ensure
that the fill color, outline color and outline width is customisable
(but only where appropriate - it won't apply to some SVG files).

My latest thought is:
- as above, ensure that fill/outline are customisable
- remove the DEFAULT param values from all the shipped svgs
- modify symbology so that if NO default param value is specified in
the svg, then the existing fill color/outline color/width is preserved
when selecting the symbol. I think this is the best solution, as it
fixes the annoying color/width reseting which currently happens when
switching svg files but without losing the ability to set a default
color within a SVG.

If no objections I'll proceed with this approach.

Nyall



>
> Thanks,
> Andreas
>
>
> On 10.10.2015 12:02, Nyall Dawson wrote:
>>
>> Hi all,
>>
>> I'm currently working on fixing some issues with svg symbol rendering.
>> I'm wondering what everyone's thoughts regarding
>> http://hub.qgis.org/issues/10908 is?
>>
>> Situation is:
>> - default fill color of svg marker symbols is white, outline is black.
>> - Up until 5 minutes ago, there was a bug regarding outline widths for
>> svg images. This meant that the width had to be ridiculously large to
>> be visible (eg 10-20x larger than desired). After fixing this bug the
>> outline is now visible in the svg image selector, so possibly that's
>> #10908 fixed.  BUT - now I think the default svg marker width is much
>> too large (1 mm). I think this should be something more like 0.2 mm.
>>
>> So I need some feedback. What should be the CORRECT default SVG marker
>> fill and border color, and border width?
>>
>> (Personally, I'm leaning toward leaving it as white fill, black
>> outline, 0.2mm width.)
>>
>> Nyall
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/qgis-developer


More information about the Qgis-developer mailing list