[jira] [Created] (BATIK-1178) Font fallback mechanism selects wrong font

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[jira] [Created] (BATIK-1178) Font fallback mechanism selects wrong font

JIRA jira@apache.org
Matthias Reischenbacher created BATIK-1178:
----------------------------------------------

             Summary: Font fallback mechanism selects wrong font
                 Key: BATIK-1178
                 URL: https://issues.apache.org/jira/browse/BATIK-1178
             Project: Batik
          Issue Type: Bug
          Components: GVT Text
            Reporter: Matthias Reischenbacher


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".




--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]