quick fix of https://github.com/Kozea/CairoSVG/issues/317#408
quick fix of https://github.com/Kozea/CairoSVG/issues/317#408Pandaaaa906 wants to merge 3 commits intoKozea:mainfrom
Conversation
…nchor # Conflicts: # cairosvg/text.py
|
Thanks for the PR. That’s funny, I think we just "solved" an equivalent bug in WeasyPrint, in Kozea/WeasyPrint@1460522. The code is a bit different, so we can’t just copy/paste the diff, but it may be possible to get some ideas. (I didn’t look deeply at your PR yet, that was just an idea.) |
|
Thx for the reply. This 'text-anchor' problem seem to be a broad issue in svg rendering, the main cause is the I think i also fix another issue. 😄 ...
<g>
<text xml:space="preserve" text-anchor="end" text-rendering="geometricPrecision">
<tspan x="220.05" y="199.25" font-family="Times New Roman" font-size="8" fill="rgb(0, 0, 0)">H</tspan>
<tspan font-family="Times New Roman" dy="1.78" font-size="6" fill="rgb(0, 0, 0)">3</tspan>
<tspan font-family="Times New Roman" dy="-1.78" font-size="8" fill="rgb(0, 0, 0)">C</tspan>
</text>
</g>
...addtionally i concerned about the alignment on y coordinate, but i don't have much cases to test. |

a quick fix for #317
svg content:
result:
