Bug 45342 - [PATCH] AFP Renderer does not properly handle AFP fonts with relative metric
Summary: [PATCH] AFP Renderer does not properly handle AFP fonts with relative metric
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: fonts (show other bugs)
Version: all
Hardware: PC Windows XP
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2008-07-04 05:20 UTC by Emil Maskovsky
Modified: 2012-04-01 06:38 UTC (History)
0 users



Attachments
changed AFPFontReader.java (19.72 KB, text/plain)
2008-07-04 05:20 UTC, Emil Maskovsky
Details
Patch against current trunk (8.50 KB, patch)
2008-11-28 03:15 UTC, Emil Maskovsky
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Emil Maskovsky 2008-07-04 05:20:46 UTC
Created attachment 22215 [details]
changed AFPFontReader.java

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.
Comment 1 Emil Maskovsky 2008-11-28 03:15:43 UTC
Created attachment 22958 [details]
Patch against current trunk

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.
Comment 2 Jeremias Maerki 2009-02-09 07:37:03 UTC
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.
Comment 3 Glenn Adams 2012-04-01 06:38:13 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed