You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by bu...@apache.org on 2008/02/01 22:15:53 UTC

DO NOT REPLY [Bug 44343] New: - font-size in percentage error

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44343>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44343

           Summary: font-size in percentage error
           Product: Fop
           Version: 0.94
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: pdf
        AssignedTo: fop-dev@xmlgraphics.apache.org
        ReportedBy: lih@peacetech.com


Error occurs in the combination of <fo:inline> of font-size="smaller"/"bigger" 
within <fo:block> of font-size in percentage. The error is "getBaselength 
called without context".
  
  <fo:block font-style="normal" font-size="80%" role="html:div"
    <fo:inline baseline-shift="super" font-size="smaller" 
role="html:sup">th</fo:inline>of each month. 
  </fo:block>

=====Original Post on fop-users mailing list===========
On Feb 1, 2008, at 18:36, Li, Hao wrote:

> 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:

OK, now I see it too.

I'll run it through the debugger, but already think I know what is going on. 
The property resolution mechanism tries to resolve to smaller/larger font-
sizes too early. Percentages are resolved (mostly
anyway) during the layout-stage, where FOP tries to already resolve 
the "smaller" keyword long before that.

I haven't tried yet, but using em's could also lead to trouble in combination 
with percentages, as in:

<fo:block>
   <fo:block font-size="80%">
     <fo:inline font-size="8em">


Will keep you posted.

Cheers

Andreas

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

DO NOT REPLY [Bug 44343] - relative font-size (smaller/larger) does not work with percentages

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44343>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44343


adelmelle@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
            Summary|font-size in percentage     |relative font-size
                   |error                       |(smaller/larger) does not
                   |                            |work with percentages




------- Additional Comments From adelmelle@apache.org  2008-02-01 14:24 -------

Already had a quick look, and just one question. 
Does FOP also hang on your end? FOP Trunk indeed shows the error you mention, then simply hangs 
here... Seems like this is going to take some time figuring out.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

DO NOT REPLY [Bug 44343] - relative font-size (smaller/larger) does not work with percentages

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44343>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44343





------- Additional Comments From adelmelle@apache.org  2008-02-01 14:38 -------
(In reply to comment #1)
> ... Seems like this is going to take some time figuring out.

I take that back. Already found the related piece of code.

For other interested parties: in case the parent's font-size is a percentage, the getValue() call in 
FontSizePropertyMaker.convertProperty() returns a base-size of 0. This case does not seem to be 
catered for in the loop in computeClosestAbsoluteFontSize() a bit further below, which becomes infinite 
so the method never returns.

It seems like percentage font-sizes can already be resolved at parse-time. There seems to be no need 
to create PercentLengths and delay the resolution until the layout-context is available. I'm going to 
investigate this. In the meantime, if anyone has ideas or insights... always welcome.


-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

DO NOT REPLY [Bug 44343] - relative font-size (smaller/larger) does not work with percentages

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=44343>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=44343


adelmelle@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED




------- Additional Comments From adelmelle@apache.org  2008-02-01 15:32 -------

Fixed in FOP Trunk.

see: http://svn.apache.org/viewvc?rev=617708&view=rev

Thanks for reporting.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.