EtheaDev / SVGIconImageList

Three engines to render SVG (Delphi Image32, Skia4Delphi, Direct2D wrapper) and four components to simplify use of SVG images (resize, fixedcolor, grayscale...)
Apache License 2.0
327 stars 96 forks source link

Text not rendered properly #175

Closed rittjom closed 3 years ago

rittjom commented 3 years ago

Hi,

in my example SVG the Text Rendering seems to be incorrect.

Expected: badge_correct

Actual: badge_wrong

Example SVG:

badge_bug_text_anchor_middle.svg.zip

carloBarazzetta commented 3 years ago

You are using some keywords not "managed" by this library. You can correct the text like this:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" width="48px" height="48px">
<g id="badge_right_top">
<rect fill="#f23a3a" id="badge_right_top_rect" width="24" height="14" x="1" y="2" rx="4" ry="4" />
<text fill="#ffffff" id="badge_right_top_text" font-family="Arial, sans-serif;" font-size="12" font-weight="bold" x="3" y="13">999</text>
</g>
</svg>

If you want, you can use this useful viewer/editor to edit manually your SVG files: https://github.com/EtheaDev/SVGShellExtensions