Kozea / CairoSVG

Convert your vector images
https://courtbouillon.org/cairosvg
GNU Lesser General Public License v3.0
763 stars 150 forks source link

SVG text paint-order = "stroke" is not supported #218

Open aziesemer opened 5 years ago

aziesemer commented 5 years ago

If you try this code:

<svg id="floor2" class="floor" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" version="1.1" viewBox="-33250 -7500 800 250">
<style type="text/css">.ruler-text.metric{fill:#000; font:107pt arial; text-anchor:middle; alignment-baseline:middle; paint-order: stroke; stroke: #ff0; stroke-width: 10pt; stroke-linecap: butt; stroke-linejoin: miter}</style>
<text transform="translate(-32852.4 -7353.87) rotate(0)" class="ruler-text metric">2.66m</text>
</svg>

You'll end up with:

screen shot 2018-11-15 at 9 54 34 am

instead of:

screen shot 2018-11-15 at 9 55 51 am

PR #217 fixes that.

liZe commented 5 years ago

paint-order has been added in SVG 2.0 and CairoSVG doesn't have a clear plan to support this new version :smile:. By the way, this change seems harmless and there's no reason not to include it. Thank you!

liZe commented 5 years ago

Oh, I didn't realize that #217 and #218 were conflicting. I have to check this.

aziesemer commented 5 years ago

@liZe Yes, I have it merged in my computer but had to split in order to produce 2 different PRs.

aziesemer commented 5 years ago

@liZe I fixed the conflict in the same PR and it should work now.