Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
None
-
None
-
None
Description
If there is a SVG text element that is displayed with different fonts, the StrokingTextPainter selects the wrong font for the first char after switching from the first to the fallback font.
E.g.
<tspan x="10" y="100" style="font-size:100px;font-family:Arial,'Arial Unicode MS';">= 的槽接触面</tspan>
"= " --> Will be rendered with "Arial"
"的" --> Will be rendered with any font that can display this character
"槽接触面" --> Will be rendered with "Arial Unicode MS"
See also the attached SVG test case and two PNG files, which were transcoded from this SVG after and before my fix.
This issue is caused by the createModifiedACIForFontMatching() method inside StrokingTextPainter, which skips one character after the first few characters are matched to "Arial". This leaves one character with no font assigned (see fontAssigned array), which causes the subsequent code to assign any font, that can display the character.
I'll add a patch that, so that
"= " is rendered with "Arial" and
"的槽接触面" with "Arial Unicode MS".