You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-users@xmlgraphics.apache.org by jsolutions <jo...@jsolutions.co.uk> on 2013/03/20 13:17:46 UTC

line-height.conditionality

I'm trying to get rid of half leading at the top and bottom of reference
areas, as the line-height.conditionality property should, but I cannot get
it to work. 

I'm sure I must be doing something wrong as I have been unable to find a
lack of compliance on the FOP web site. However, looking through the source
code (1.1) I cannot find where it is used. I am a little confused.

Here's some test code I cannot get working:

<?xml version="1.0" encoding="UTF-8"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
    <fo:layout-master-set>
        <fo:simple-page-master master-name="page">
            <fo:region-body region-name="body" margin="25.4mm" 
                            border-width="0.1pt" 
                            border-color="rgb(0,0,0)" 
                            border-style="solid" 
                            padding="0pt"/>
        </fo:simple-page-master>
    </fo:layout-master-set>
    <fo:page-sequence master-reference="page">
        <fo:flow font-family="Times" flow-name="body">
                <fo:block font-size="36pt" 
                          line-height="72pt"
                          line-height.conditionality="discard" 
                          border-width="0.1pt" 
                          border-color="rgb(255,0,0)" 
                          border-style="solid">É Here is some 36pt text,
with 72pt height.</fo:block>
        </fo:flow>
    </fo:page-sequence>
</fo:root>

What am I doing wrong?

JC



--
View this message in context: http://apache-fop.1065347.n5.nabble.com/line-height-conditionality-tp38191.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: line-height.conditionality

Posted by Chris Bowditch <bo...@hotmail.com>.
Hi John,

Sorry I didn't appreciate the full scenario you were looking at in your 
previous e-mail. Please do submit a patch if you have one, as I'm sure 
it will come in handy for others.

Thanks,

Chris

On 26/03/2013 08:11, jsolutions wrote:
> Thanks Chris,
>
> That is not really the scenario I'm dealing with. I specifically want there
> to be no half leading above the first line in a reference area. At the
> bottom of a reference area, I want the line breaking to allow a line to fit
> on the page when it's line-height is too big for the page, but if you remove
> the bottom half leading then it can fit.
>
> Here is an example of it not working with the input data given, the black
> border is on the body region and the red border on the block I want
> line-height.conditionality to apply to:
>
> output.pdf <http://apache-fop.1065347.n5.nabble.com/file/n38226/output.pdf>
>
> I thought this was the main purpose of the line-height.conditionality
> property?
>
> Anyway, I have made some modifications to the fop source and split the line
> area into a box/glue/penalty rather than a single box, when determining page
> breaks.
>
> I may submit it if I thought there was enough interest, but the lack of
> response and also the fact that RenderX and Antenna House also don't appear
> to support it. The fact that they didn't appear to made me think I was doing
> something wrong.
>
> Cheers
>
> JC
>
>
>
> -----
> John Cumming - jSolutions Ltd
> http://www.jsolutions.co.uk
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/line-height-conditionality-tp38191p38226.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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


Re: line-height.conditionality

Posted by Vincent Hennebert <vh...@gmail.com>.
Hi John,

line-height.conditionality is indeed what you are looking for, and it’s
not implemented yet in FOP.

ATM only the .optimum component of line-height is passed to
LineLayoutManager. This would have to be changed to pass all of the
components.

Then something would have to happen in
LineBreakingAlgorithm.makeLineBreakPosition, where there might be
a little difficulty due to the fact that half-leading must not be taken
into account when line-stacking-strategy="line-height" (although
I believe that value is not supported yet).

Then in LineLayoutManager.postProcessLineBreaks, additional elements
corresponding to space-before and space-after would have to be added to
the returned list (but you seem to have figured that out already).
I would take inspiration from
BlockStackingLM.addKnuthElementForSpaceBefore. It should be possible to
generate a SpaceProperty computed from the half-leading.

If you’re lucky that would be enough to get the conditionality working.

HTH,
Vincent


On 26/03/13 09:11, jsolutions wrote:
> Thanks Chris, 
> 
> That is not really the scenario I'm dealing with. I specifically want there
> to be no half leading above the first line in a reference area. At the
> bottom of a reference area, I want the line breaking to allow a line to fit
> on the page when it's line-height is too big for the page, but if you remove
> the bottom half leading then it can fit.
> 
> Here is an example of it not working with the input data given, the black
> border is on the body region and the red border on the block I want
> line-height.conditionality to apply to:
> 
> output.pdf <http://apache-fop.1065347.n5.nabble.com/file/n38226/output.pdf>  
> 
> I thought this was the main purpose of the line-height.conditionality
> property?
> 
> Anyway, I have made some modifications to the fop source and split the line
> area into a box/glue/penalty rather than a single box, when determining page
> breaks. 
> 
> I may submit it if I thought there was enough interest, but the lack of
> response and also the fact that RenderX and Antenna House also don't appear
> to support it. The fact that they didn't appear to made me think I was doing
> something wrong.
> 
> Cheers
> 
> JC
> 
> 
> 
> -----
> John Cumming - jSolutions Ltd
> http://www.jsolutions.co.uk
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/line-height-conditionality-tp38191p38226.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> 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


Re: line-height.conditionality

Posted by jsolutions <jo...@jsolutions.co.uk>.
Thanks Chris, 

That is not really the scenario I'm dealing with. I specifically want there
to be no half leading above the first line in a reference area. At the
bottom of a reference area, I want the line breaking to allow a line to fit
on the page when it's line-height is too big for the page, but if you remove
the bottom half leading then it can fit.

Here is an example of it not working with the input data given, the black
border is on the body region and the red border on the block I want
line-height.conditionality to apply to:

output.pdf <http://apache-fop.1065347.n5.nabble.com/file/n38226/output.pdf>  

I thought this was the main purpose of the line-height.conditionality
property?

Anyway, I have made some modifications to the fop source and split the line
area into a box/glue/penalty rather than a single box, when determining page
breaks. 

I may submit it if I thought there was enough interest, but the lack of
response and also the fact that RenderX and Antenna House also don't appear
to support it. The fact that they didn't appear to made me think I was doing
something wrong.

Cheers

JC



-----
John Cumming - jSolutions Ltd
http://www.jsolutions.co.uk
--
View this message in context: http://apache-fop.1065347.n5.nabble.com/line-height-conditionality-tp38191p38226.html
Sent from the FOP - Users mailing list archive at Nabble.com.

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


Re: line-height.conditionality

Posted by Chris Bowditch <bo...@hotmail.com>.
Hi,

If you want to get rid of half leading on areas containing images or 
other non text items then specify font-size="0pt" If the area contains 
text then you can specify line-height="1.0" (default is 1.2x font size)

HTH,

Chris

On 20/03/2013 12:17, jsolutions wrote:
> I'm trying to get rid of half leading at the top and bottom of reference
> areas, as the line-height.conditionality property should, but I cannot get
> it to work.
>
> I'm sure I must be doing something wrong as I have been unable to find a
> lack of compliance on the FOP web site. However, looking through the source
> code (1.1) I cannot find where it is used. I am a little confused.
>
> Here's some test code I cannot get working:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
>      <fo:layout-master-set>
>          <fo:simple-page-master master-name="page">
>              <fo:region-body region-name="body" margin="25.4mm"
>                              border-width="0.1pt"
>                              border-color="rgb(0,0,0)"
>                              border-style="solid"
>                              padding="0pt"/>
>          </fo:simple-page-master>
>      </fo:layout-master-set>
>      <fo:page-sequence master-reference="page">
>          <fo:flow font-family="Times" flow-name="body">
>                  <fo:block font-size="36pt"
>                            line-height="72pt"
>                            line-height.conditionality="discard"
>                            border-width="0.1pt"
>                            border-color="rgb(255,0,0)"
>                            border-style="solid">É Here is some 36pt text,
> with 72pt height.</fo:block>
>          </fo:flow>
>      </fo:page-sequence>
> </fo:root>
>
> What am I doing wrong?
>
> JC
>
>
>
> --
> View this message in context: http://apache-fop.1065347.n5.nabble.com/line-height-conditionality-tp38191.html
> Sent from the FOP - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> 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