xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Li, Hao" <...@peacetech.com>
Subject RE: font-size in percentage error
Date Fri, 01 Feb 2008 17:36:22 GMT
You are right. The sample I posted actually works. I apologize not
recognizing the real problem. It is tricky and only occurs in the
combination of <fo:inline> of font-size="smaller"/"bigger" within
<fo:block> of font-size in percentage:

<fo:block font-style="normal" space-after="0.1cm" space-before="0.1cm"
font-size="80%" role="html:div" text-align="left">The 15<fo:inline
baseline-shift="super" font-size="smaller"
role="html:sup">th</fo:inline>of each month. </fo:block>

Thank you very much,


-----Original Message-----
From: Andreas Delmelle [mailto:andreas.delmelle@telenet.be] 
Sent: Thursday, January 31, 2008 3:04 PM
To: fop-users@xmlgraphics.apache.org
Subject: Re: font-size in percentage error

On Jan 31, 2008, at 18:14, Li, Hao wrote:

Hi

> We encountered the problem of using percentage on font-size attribute.
> The error is "getBaselength called without context".
> <snip />
> Two cases can bypass this error:
> 1. Changing the font-size attribute to a non-percentage (i.e. 10pt or
> 12px).

Indeed, this will simply bypass the percentage-resolution, so the  
problem does not occur here.

> 2. If the font-size attribute (%) was in an <fo:inline>.
>   <fo:block><fo:block font-style="normal" space-after="0.1cm"
> space-before="0.1cm"  font-size="10pt" role="html:div"
> text-align="left">
>   <fo:inline font-weight="bold" role="html:strong" font- 
> size="80%">Type
> of Report</fo:inline></fo:block>
> </fo:block>
>
>
> We are not sure if this is a bug, or we are not using it correctly.

It definitely seemed like a bug to me, especially because you  
mentioned the case of nested blocks.

On the other hand, (good news?) I cannot reproduce your issue with  
the latest development version of FOP. Which version are you using?

If percentages are an issue, then maybe em's will do the trick for you:

<fo:block>
   <fo:block font-size="0.8em">

should produce the exact same effect.


HTH!


Cheers

Andreas

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org


Mime
View raw message