Fop
  1. Fop
  2. FOP-1934

[PATCH] SVG text in AFP creates miscoded GOCA text

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: fonts
    • Labels:
      None
    • Environment:
      Operating System: Linux
      Platform: PC
    • External issue ID:
      51209

      Description

      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.

      1. afp_goca_font_xconf.patch
        9 kB
        Luis Bernardo
      2. bug.fo
        1 kB
        Mehdi Houshmand

        Activity

        Hide
        Mehdi Houshmand added a comment -

        Patch applied, this can be closed

        Show
        Mehdi Houshmand added a comment - Patch applied, this can be closed
        Hide
        Glenn Adams added a comment -

        increase priority due to presence of a patch

        Show
        Glenn Adams added a comment - increase priority due to presence of a patch
        Hide
        Glenn Adams added a comment -

        resetting P2 open bugs to P3 pending further review

        Show
        Glenn Adams added a comment - resetting P2 open bugs to P3 pending further review
        Hide
        Chris Bowditch added a comment -

        Hi Luis,

        Thanks for the patch. This has been committed in revision 1232845.

        Thanks,

        Chris

        Show
        Chris Bowditch added a comment - Hi Luis, Thanks for the patch. This has been committed in revision 1232845. Thanks, Chris
        Hide
        Luis Bernardo added a comment -

        edited title to reflect patch

        Show
        Luis Bernardo added a comment - edited title to reflect patch
        Hide
        Luis Bernardo added a comment -

        Attachment afp_goca_font_xconf.patch has been added with description: patch to address issue described

        Show
        Luis Bernardo added a comment - Attachment afp_goca_font_xconf.patch has been added with description: patch to address issue described
        Hide
        Mehdi Houshmand added a comment -

        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.

        Show
        Mehdi Houshmand added a comment - 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.
        Hide
        Mehdi Houshmand added a comment -

        Attachment bug.fo has been added with description: GOCA text poorly encoded test

        Show
        Mehdi Houshmand added a comment - Attachment bug.fo has been added with description: GOCA text poorly encoded test

          People

          • Assignee:
            fop-dev
            Reporter:
            Mehdi Houshmand
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development