xmlgraphics-batik-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthias Reischenbacher (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BATIK-1178) [PATCH] Font fallback mechanism selects wrong font
Date Mon, 27 Feb 2017 20:10:46 GMT

     [ https://issues.apache.org/jira/browse/BATIK-1178?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

Matthias Reischenbacher updated BATIK-1178:
    Summary: [PATCH] Font fallback mechanism selects wrong font  (was: Font fallback mechanism
selects wrong font)

> [PATCH] 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
>         Attachments: 1178.patch, 1178_test_case_fixed.png, 1178_test_case.png, 1178_test_case.svg
> 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';">=
> "= " --> 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

To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org

View raw message