Summary: | [PATCH] SVG text in AFP creates miscoded GOCA text | ||
---|---|---|---|
Product: | Fop - Now in Jira | Reporter: | Mehdi Houshmand <med1985> |
Component: | fonts | Assignee: | fop-dev |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | P2 | ||
Version: | all | ||
Target Milestone: | --- | ||
Hardware: | PC | ||
OS: | Linux | ||
Attachments: |
GOCA text poorly encoded test
patch to address issue described |
To add to this, if you wish to produce the correctly rendered AFP, you can change the EBCDIC encoding scheme to "CP500". This can be done by changing o.a.f.afp.goca.GraphicsCharacterString.getStringAsBytes() from: private byte[] getStringAsBytes() throws UnsupportedEncodingException { return str.getBytes(AFPConstants.EBCIDIC_ENCODING); } To: private byte[] getStringAsBytes() throws UnsupportedEncodingException { return str.getBytes("Cp500"); } This will provide the correct encoding scheme for Helvetica ONLY and render the FO properly. Though obviously this doesn't address the larger issue already described. Created attachment 28122 [details]
patch to address issue described
edited title to reflect patch Hi Luis, Thanks for the patch. This has been committed in revision 1232845. Thanks, Chris resetting P2 open bugs to P3 pending further review increase priority due to presence of a patch Patch applied, this can be closed |
Created attachment 27014 [details] GOCA text poorly encoded test This bug is caused by the SVG fonts are handled in AFP (and in general). There is a disparity between the way normal text, which is rendered into PTOCA, and SVG text, which is rendered to GOCA, is handled. The EBCDIC encoding isn't passed through to the GOCA object (GraphicalCharacterString), the GCS ALWAYS converts text using Cp1146 encoding regardless of what's given in the fop.xconf. I've attached an FO that illustrates the point. I'm not that familiar with SVG so I may have copy/pasted some superfluous information but the bug is clearly visible if converted to AFP.