Fop
  1. Fop
  2. FOP-1552

[PATCH] AFP Renderer does not properly handle AFP fonts with relative metric

    Details

    • Type: Bug Bug
    • Status: Closed
    • Resolution: Fixed
    • Affects Version/s: trunk
    • Fix Version/s: None
    • Component/s: fonts
    • Labels:
    • Environment:
      Operating System: Windows XP
      Platform: PC
    • External issue ID:
      45342

      Description

      I've tried to use AFP renderer along with AFP fonts with relative metrics, which results in wrong alignment of text. For both Outline fonts (scalable) and Raster fonts.

      After some debugging I've updated the org.apache.fop.render.afp.fonts.AFPFontReader.java file to process these fonts correctly, I attach the updated Java file below. (the main problem is, that AFP fonts have two measurement unit setting, which should be both considered for fonts with relative metric - metric resolution and shape resolution; and the factor to be applied to measurement values depends on the pointsize in some cases)

      In the source file there is also repaired one other problem - there was bug, that the font reader did not process the last font orientation, it is repaired in the method processFontPosition().

      The changes were made on the source file from FOP version 0.95.beta.

      1. AFPFontReader.java
        20 kB
        Emil Maskovsky
      2. AFPFontReader Patch.txt
        8 kB
        Emil Maskovsky

        Activity

        Glenn Adams made changes -
        Field Original Value New Value
        Affects Version/s trunk [ 12323672 ]
        Affects Version/s all [ 12323671 ]
        Hide
        Glenn Adams added a comment -

        batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed

        Show
        Glenn Adams added a comment - batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed
        Hide
        Jeremias Maerki added a comment -

        Emil, thanks a lot for your patch. Apologies for not processing it earlier. I've only noticed it recently. I've applied it with modifications:
        http://svn.apache.org/viewvc?rev=742564&view=rev

        The values your patch produced were too big by factors of more than 1000. I've had to change some of that code. I've tested now with various fonts (with fixed and relative metrics) and I'm happy with the results. Please verify also on your side. Maybe you have different fonts that behave differently. If that is so, we may have to take a closer look. Let me know if there are any remaining problems.

        Show
        Jeremias Maerki added a comment - Emil, thanks a lot for your patch. Apologies for not processing it earlier. I've only noticed it recently. I've applied it with modifications: http://svn.apache.org/viewvc?rev=742564&view=rev The values your patch produced were too big by factors of more than 1000. I've had to change some of that code. I've tested now with various fonts (with fixed and relative metrics) and I'm happy with the results. Please verify also on your side. Maybe you have different fonts that behave differently. If that is so, we may have to take a closer look. Let me know if there are any remaining problems.
        Hide
        Emil Maskovsky added a comment -

        Attachment AFPFontReader Patch.txt has been added with description: Patch against current trunk

        Show
        Emil Maskovsky added a comment - Attachment AFPFontReader Patch.txt has been added with description: Patch against current trunk
        Hide
        Emil Maskovsky added a comment -

        I've created patch against current trunk. I tested it to work correctly with fonts with absolute and relative metrics, outline and raster AFP fonts.

        Show
        Emil Maskovsky added a comment - I've created patch against current trunk. I tested it to work correctly with fonts with absolute and relative metrics, outline and raster AFP fonts.
        Emil Maskovsky created issue -
        Hide
        Emil Maskovsky added a comment -

        Attachment AFPFontReader.java has been added with description: changed AFPFontReader.java

        Show
        Emil Maskovsky added a comment - Attachment AFPFontReader.java has been added with description: changed AFPFontReader.java

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development