Bug 40442 - [PATCH] percent length not working in font-size for rtf output
Summary: [PATCH] percent length not working in font-size for rtf output
Status: CLOSED FIXED
Alias: None
Product: Fop - Now in Jira
Classification: Unclassified
Component: rtf (show other bugs)
Version: 0.92
Hardware: All All
: P2 normal
Target Milestone: ---
Assignee: fop-dev
URL:
Keywords: PatchAvailable
Depends on:
Blocks:
 
Reported: 2006-09-08 08:13 UTC by Renaud Michel
Modified: 2012-04-01 06:38 UTC (History)
0 users



Attachments
patch that add PercentBaseContext (4.81 KB, patch)
2006-09-08 08:25 UTC, Renaud Michel
Details | Diff
simpler fix (1.39 KB, patch)
2006-09-16 18:16 UTC, Renaud Michel
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Renaud Michel 2006-09-08 08:13:35 UTC
Using a relative font-size, like this  
<fo:block font-size="120%">test</fo:block>  
always gives the smallest font size possible.  
  
This is due to the fact that in  
org.apache.fop.render.rtf.FOPRtfAttributes.setHalfPoints(String,Length)  
getValue is used without a context.
Comment 1 Renaud Michel 2006-09-08 08:25:32 UTC
Created attachment 18840 [details]
patch that add PercentBaseContext

The patch is against 0.92, but should apply to trunk as well, as the only
differences to these files are header diffs.

This is a proposed modification to org.apache.fop.render.rtf.FOPRtfAttributes
and org.apache.fop.render.rtf.TextAttributesConverter wich create
LayoutManagers to use them as PercentBaseContext.
Comment 2 Jeremias Maerki 2006-09-11 06:48:39 UTC
Creating LayoutManagers in RTF output is not really the right idea.
LayoutManagers are to be used only inside the "layout engine" which for RTF
isn't used. I realize it's a tempting move but from a design perspective, it is
wrong. A different solution has to be found. IMO, we have to have special
implementations for PercentBaseContext for output formats which don't use the
layout engine. These implementations could even be used by the layout managers,
thus removing the need to implement PercentBaseContext there.

If another committer disagrees with my statement, please reopen the issue.
Comment 3 Renaud Michel 2006-09-16 18:16:56 UTC
Created attachment 18876 [details]
simpler fix

New, simpler fix for percent font problem in RTF output.
Comment 4 Renaud Michel 2006-09-16 18:27:06 UTC
You are right, and it is not necessary to have a big and well-implemented 
PercentBaseContext for this case.
Here, the context is only used for font calculation and so, looking at 
FixedLength, PercentLength and LengthBase I only need here a context that is 
non null.

I sent a new patch (against current trunk) that simply send a dummy 
implementation of PercentBaseContext that fix my problem (just try the 
helloworld example with a font-size="150%" on the fo:block with and without 
this patch).
Comment 5 Simon Pepping 2006-10-09 06:07:21 UTC
Patch applied in revision 454369. Thanks.
Comment 6 Glenn Adams 2012-04-01 06:38:09 UTC
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed