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.
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.
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.
Created attachment 18876 [details] simpler fix New, simpler fix for percent font problem in RTF output.
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).
Patch applied in revision 454369. Thanks.
batch transition pre-FOP1.0 resolved+fixed bugs to closed+fixed