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 Adam Augusta <ro...@WPI.EDU> on 2004/07/06 23:18:37 UTC

line-height interpretation

The 'line-height' property is supposed to specify the height of a text 
block as a multiple of the font size.  The spec* says that the user agent 
may pick a reasonable multiplier, recommended between 1 and 1.2.  I said 
"Forget that!  I want to my spacing to be deterministic, thank you very 
much.  What is this, CSS?"  So I specified my own spacing.

*http://www.w3.org/TR/xsl/slice7.html#line-height

No matter what line height I pick, the engine seems to add 5pt plus a 
little more.  So if I pick 17pt, I get 22pt+, and if I pick 7pt, I get 
12pt+.  The compliance page says that the property is fully implemented.  
So why am I getting this 5pt+ discrepancy?

(Yes, line-height="1" gives the same result for me as line-height="14pt" 
with a 14pt font.  That is, 19pt+.  Setting force/minimum/maximum etc has 
no effect.)

As you can see, I set the border, padding, and spacing to 0.

<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <fo:layout-master-set>
  <fo:simple-page-master master-name="1" page-height="5.25in" 
page-width="7.75in" margin-top="0cm" margin-bottom="0cm" margin-left="0cm" 
margin-right="0cm">
   <fo:region-body margin-top="0cm" margin-bottom="0cm"/>
   <fo:region-before extent="0cm"/>
   <fo:region-after extent="0cm"/>
  </fo:simple-page-master>
 </fo:layout-master-set>
 <fo:page-sequence master-reference="1">
  <fo:flow flow-name="xsl-region-body">
   <fo:block-container font-family="Papyrus" font-size="14pt" 
color="#ff0000" display-align="center" wrap-option="no-wrap" 
overflow="hidden" text-align="center" position="absolute" top="1.31in" 
left="0.37in" height="3.5in" width="7in">
    <fo:table table-layout="fixed" width="100%">
     <fo:table-column column-width="proportional-column-width(1)"/>
     <fo:table-body>
      <fo:table-row height="3.5in">
       <fo:table-cell text-align="center" display-align="center">
        <fo:block line-height="17pt" space-before="0pt" space-after="0pt" 
padding="0pt" border-width="0pt">This is line 1.</fo:block>
        <fo:block line-height="17pt" space-before="0pt" space-after="0pt" 
padding="0pt" border-width="0pt">This is line 2.</fo:block>
        <fo:block line-height="17pt" space-before="0pt" space-after="0pt" 
padding="0pt" border-width="0pt">This is line 3.</fo:block>
       </fo:table-cell>
      </fo:table-row>
     </fo:table-body>
    </fo:table>
   </fo:block-container>
  </fo:flow>
 </fo:page-sequence>
</fo:root>

-Adam



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


Re: line-height interpretation

Posted by Adam Augusta <ro...@WPI.EDU>.
On Tue, 6 Jul 2004, Clay Leeds wrote:

> Adam,
> 
> On Jul 6, 2004, at 2:18 PM, Adam Augusta wrote:
> > The 'line-height' property is supposed to specify the height of a text
> > block as a multiple of the font size.  The spec* says that the user 
> > agent
> > may pick a reasonable multiplier, recommended between 1 and 1.2.  I 
> > said
> > "Forget that!  I want to my spacing to be deterministic, thank you very
> > much.  What is this, CSS?"  So I specified my own spacing.
> >
<snip />
> > No matter what line height I pick, the engine seems to add 5pt plus a
> > little more.  So if I pick 17pt, I get 22pt+, and if I pick 7pt, I get
> > 12pt+.  The compliance page says that the property is fully 
> > implemented.
> > So why am I getting this 5pt+ discrepancy?
<snip />
> 
> I don't know if it makes a difference, but it may help to know what the 
> output target is (PDF? AWT? PS?) as well as the JVM/JDK. I've found 
> kerning differences in output between AWT (-awt & -print) vs. PDF, that 
> is affected (exacerbated?) by the version of the Java Virtual Machine. 
> I realize you are writing about line-height, but perhaps (hopefully?) 
> this may contribute to a workaround. In either case, perhaps we need to 
> update the /compliance.html...
> 
> Web Maestro Clay

PDF output
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-b04)

The only workaround I can think of is to make each line a block container 
with an absolute position.  *grimace*

-Adam

PS: Generating an SVG representation of a block container, putting a
rotate transform on the SVG group, and then reembedding that SVG into a
larger XSL:FO document seems to work well!  I can even rotate to non-90
degree orientations, but then of course I have to do some trig with widths
and reference points.  (Of course, with the problem above, I'm going to 
have to come up with new reference points for every line. *shudder*)



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


Re: line-height interpretation

Posted by Clay Leeds <cl...@medata.com>.
Adam,

On Jul 6, 2004, at 2:18 PM, Adam Augusta wrote:
> The 'line-height' property is supposed to specify the height of a text
> block as a multiple of the font size.  The spec* says that the user 
> agent
> may pick a reasonable multiplier, recommended between 1 and 1.2.  I 
> said
> "Forget that!  I want to my spacing to be deterministic, thank you very
> much.  What is this, CSS?"  So I specified my own spacing.
>
> *http://www.w3.org/TR/xsl/slice7.html#line-height
>
> No matter what line height I pick, the engine seems to add 5pt plus a
> little more.  So if I pick 17pt, I get 22pt+, and if I pick 7pt, I get
> 12pt+.  The compliance page says that the property is fully 
> implemented.
> So why am I getting this 5pt+ discrepancy?
>
> (Yes, line-height="1" gives the same result for me as 
> line-height="14pt"
> with a 14pt font.  That is, 19pt+.  Setting force/minimum/maximum etc 
> has
> no effect.)
>
> As you can see, I set the border, padding, and spacing to 0.

<snip what="xsl-fo_content"/>

> -Adam

I don't know if it makes a difference, but it may help to know what the 
output target is (PDF? AWT? PS?) as well as the JVM/JDK. I've found 
kerning differences in output between AWT (-awt & -print) vs. PDF, that 
is affected (exacerbated?) by the version of the Java Virtual Machine. 
I realize you are writing about line-height, but perhaps (hopefully?) 
this may contribute to a workaround. In either case, perhaps we need to 
update the /compliance.html...

Web Maestro Clay


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


Re: EPS image printing problem

Posted by Jeremias Maerki <de...@greenmail.ch>.
On 09.07.2004 16:27:00 Peter Gustafsson wrote:
> > Yep. What I don't get is why it doesn't work in GhostScript 8.x. I
> > though in earlier versions of AFPL GhostScript it worked. But then, we
> > may still do something wrong the way we embed EPS files. Maybe asking
> > the GhostScript people would also be an idea.
> 
> I'm not acustumed to the development routine concerning fop but maybe this
> question should be forwarded to the development list??

Not necessary in this case, I think. All FOP developers listen into this
list anyway. If it comes to discussing implementation details we can
always switch over. In the meantime this is valuable information for FOP
users.

> Seams like there has been som changes in the standrard or something like
> that since both acrobat reader and ghostscript ignores the fop generated EPS
> files.

I've looked up the PDF 1.5 specification that Acrobat Reader 6 is based
on. In section 4.7 "External Objects" you find this:

> A PostScript XObject (Section 4.7.1, “PostScript XObjects”) contains a
> fragment of code expressed in the PostScript page description language.
> PostScript XObjects are no longer recommended to be used.

The second sentence wasn't there in PDF 1.4 which probably means that
Adobe removed the support for PostScript XObjects entirely.

Still doesn't explain why it doesn't work in GhostScript 8.x.

Jeremias Maerki


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


Re: EPS image printing problem

Posted by Peter Gustafsson <gu...@telia.com>.
> Yep. What I don't get is why it doesn't work in GhostScript 8.x. I
> though in earlier versions of AFPL GhostScript it worked. But then, we
> may still do something wrong the way we embed EPS files. Maybe asking
> the GhostScript people would also be an idea.

I'm not acustumed to the development routine concerning fop but maybe this
question should be forwarded to the development list??

Seams like there has been som changes in the standrard or something like
that since both acrobat reader and ghostscript ignores the fop generated EPS
files.

/Peter


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


Re: EPS image printing problem

Posted by Jeremias Maerki <de...@greenmail.ch>.
On 09.07.2004 15:27:06 Peter Gustafsson wrote:
> Tanks alot...
> 
> You were right about the Ghostscript issue, installed version 7.04 and now
> the EPS image is shown in GSview.
> 
> However, the problem still remains with the printing of the EPS image
> through Acrobat Reader 6.0.

I've never tried AR6 to do that. Two years ago I worked with AR 4.x and
5.x and printed to a Fiery RIP for a Xerox DocuColor 12.

> I have tried both printing to my postscript enabled printer HPLJ 4MV and to
> the acrobat destiller and the image isn't shown in either of the cases... I
> have also tried to print to my printer but redirecting the postscript to a
> file and then view the file with GSview which doesn't show any image in the
> postscript file... Also the filesize of the postscript generated is to small
> to hold an image.
>
> So it seams that my version of Acrobat Reader doesn't attatch the embedded
> image in it's printer postscript output...
> 
> Could there be som problem with my acrobat version to maybe??

That's right. Acrobat Reader 6.0.1 doesn't seem to send an embedded EPS
to a PostScript printer. It works with 5.x (just tried) and I think it
worked with 4.x.

> Is it possible to attatch the eps file to the mail and send it??

Yes, but it seems the EPS is fine if it appears under GhostScript 7.04.
I may be however, that Acrobat 6 doesn't work with the EPS because they
expect an EPS in a different way. That would need some investigation.
But probably they just removed support for EPS files altogether. You
could ask Adobe directly...

> Even so is it still interesting since I can se the image with version 7.04
> of GhostScript that should mean that there is some other problem then image
> related right??

Yep. What I don't get is why it doesn't work in GhostScript 8.x. I
though in earlier versions of AFPL GhostScript it worked. But then, we
may still do something wrong the way we embed EPS files. Maybe asking
the GhostScript people would also be an idea.


Jeremias Maerki


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


Re: EPS image printing problem

Posted by Wouter de Vaal <wo...@online.ie>.
> > Since I indicated Ghostscript users should use 7.06 in that POST, can
> > you confirm whether or not your problem still exists in 7.06?
>
> I have only tried viewing the images with 7.04 so I wouldn't know about
7.06
> but with 7.04 the
> images shows up as intended...
>
I've tested 7.06. It works.

Wouter


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


Re: EPS image printing problem

Posted by Peter Gustafsson <gu...@telia.com>.
> Since I indicated Ghostscript users should use 7.06 in that POST, can
> you confirm whether or not your problem still exists in 7.06?

I have only tried viewing the images with 7.04 so I wouldn't know about 7.06
but with 7.04 the
images shows up as intended...

I will go on vacation for a week now but please continue the discussion
around this topic, I will read it all when I come back.

/Peter



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


Re: EPS image printing problem

Posted by Clay Leeds <cl...@medata.com>.
On Jul 9, 2004, at 6:27 AM, Peter Gustafsson wrote:
> You were right about the Ghostscript issue, installed version 7.04 and 
> now
> the EPS image is shown in GSview.

I just posted information I'm intending to COMMIT to the Graphics page 
RE: this issue in another POST[1] this morning. I understand there are 
issues with 8.x and that's primarily what my POST is about...

Since I indicated Ghostscript users should use 7.06 in that POST, can 
you confirm whether or not your problem still exists in 7.06?

Thanks!

Web Maestro Clay

[1]
http://marc.theaimsgroup.com/?l=fop-user&m=108938876703279&w=2


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


Re: EPS image printing problem

Posted by Peter Gustafsson <gu...@telia.com>.
Tanks alot...

You were right about the Ghostscript issue, installed version 7.04 and now
the EPS image is shown in GSview.

However, the problem still remains with the printing of the EPS image
through Acrobat Reader 6.0.

I have tried both printing to my postscript enabled printer HPLJ 4MV and to
the acrobat destiller and the image isn't shown in either of the cases... I
have also tried to print to my printer but redirecting the postscript to a
file and then view the file with GSview which doesn't show any image in the
postscript file... Also the filesize of the postscript generated is to small
to hold an image.

So it seams that my version of Acrobat Reader doesn't attatch the embedded
image in it's printer postscript output...

Could there be som problem with my acrobat version to maybe??

Is it possible to attatch the eps file to the mail and send it??
Even so is it still interesting since I can se the image with version 7.04
of GhostScript that should mean that there is some other problem then image
related right??

/Peter


----- Original Message ----- 
From: "Jeremias Maerki" <de...@greenmail.ch>
To: <fo...@xml.apache.org>
Sent: Friday, July 09, 2004 1:53 PM
Subject: Re: EPS image printing problem


> Peter,
>
> during the last few days we've seen that there are issues with
> GhostScript 8.x. You only give us the GSView version but not the
> GhostScript version you're using. Try the latest GNU GhostScript 7.x.
>
> By the way, I think I remember having problems a couple of years ago
> with certain EPS files in FOP. If you don't manage to have the EPS
> displayed, consider sending it to this list. Maybe we can find a
> work-around. The FO you sent is not really interesting, it's the EPS
> file.
>
> On 08.07.2004 14:21:32 Peter Gustafsson wrote:
> > Hello..
> >
> > I have a problem with printing EPS images that i have included in my fop
> > generated pdf file.
> > I know that it isn't supposed to show up in acrobat but I can't even
print
> > them.
> >
> > I have tried to view the PDF;s with GSView4.1 but the image wasn't shown
> > there either.
> >
> > Thought there was som sort of error in the image so I created a sample
image
> > with Illustrator which wasn't shown either.
> >
> > The image is however embedded in the pdf file since the file size is
rather
> > big and a space for the image is reserved in the pdf.
> >
> > I also tried viewing the pdf on another computer with the same result.
> >
> > I have tried both fop 0.20.4 and 0.20.5 (binary distrubition) and 0.20.5
> > (source) my testcode is:
> <snip/>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: fop-user-help@xml.apache.org
>
>


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


Re: EPS image printing problem

Posted by Jeremias Maerki <de...@greenmail.ch>.
Peter, 

during the last few days we've seen that there are issues with
GhostScript 8.x. You only give us the GSView version but not the
GhostScript version you're using. Try the latest GNU GhostScript 7.x.

By the way, I think I remember having problems a couple of years ago
with certain EPS files in FOP. If you don't manage to have the EPS
displayed, consider sending it to this list. Maybe we can find a
work-around. The FO you sent is not really interesting, it's the EPS
file.

On 08.07.2004 14:21:32 Peter Gustafsson wrote:
> Hello..
> 
> I have a problem with printing EPS images that i have included in my fop
> generated pdf file.
> I know that it isn't supposed to show up in acrobat but I can't even print
> them.
> 
> I have tried to view the PDF;s with GSView4.1 but the image wasn't shown
> there either.
> 
> Thought there was som sort of error in the image so I created a sample image
> with Illustrator which wasn't shown either.
> 
> The image is however embedded in the pdf file since the file size is rather
> big and a space for the image is reserved in the pdf.
> 
> I also tried viewing the pdf on another computer with the same result.
> 
> I have tried both fop 0.20.4 and 0.20.5 (binary distrubition) and 0.20.5
> (source) my testcode is:
<snip/>


Jeremias Maerki


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


EPS image printing problem

Posted by Peter Gustafsson <gu...@telia.com>.
Hello..

I have a problem with printing EPS images that i have included in my fop
generated pdf file.
I know that it isn't supposed to show up in acrobat but I can't even print
them.

I have tried to view the PDF;s with GSView4.1 but the image wasn't shown
there either.

Thought there was som sort of error in the image so I created a sample image
with Illustrator which wasn't shown either.

The image is however embedded in the pdf file since the file size is rather
big and a space for the image is reserved in the pdf.

I also tried viewing the pdf on another computer with the same result.

I have tried both fop 0.20.4 and 0.20.5 (binary distrubition) and 0.20.5
(source) my testcode is:

/Peter Gustafsson

<?xml version="1.0" encoding="ISO-8859-1"?>
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format">
 <fo:layout-master-set>
  <fo:simple-page-master margin-right="0pt" margin-left="0pt"
page-height="11in" page-width="8.5in" margin-bottom="0pt" margin-top="0pt"
master-name="main">
   <fo:region-body margin-top="0pt" margin-bottom="0pt"/>
  </fo:simple-page-master>
 </fo:layout-master-set>
 <fo:page-sequence master-reference="main">
  <fo:flow flow-name="xsl-region-body">
    <fo:block>before</fo:block>

    <fo:block>
     <fo:external-graphic width="4in" src="url('test.eps')"  />
    </fo:block>
    <fo:block>after</fo:block>

  </fo:flow>
 </fo:page-sequence>
</fo:root>


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


Re: line-height interpretation

Posted by "J.Pietschmann" <j3...@yahoo.de>.
Adam Augusta wrote:
> I think I've figured out the formula FOP uses.  I'm quite sure it's wrong; 
> the height of the block should simply be line-height, if specified in 
> length, or as a multiplier of the font-size, if specified dimensionless.
> 
> It seems to be:
> Diff(Ascender,Descender)*font-size/1000 + (line-height - font-size)

FOP adds a half-leading display space above and below the line,
the half-leading is computed as
  (lineHeight - fontState.getFontSize()) / 2

There are numerous inconsistencies in the application though.

J.Pietschmann

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


Re: line-height interpretation

Posted by Adam Augusta <ro...@WPI.EDU>.
On Tue, 6 Jul 2004, Adam Augusta wrote:

> No matter what line height I pick, the engine seems to add 5pt plus a 
> little more.  So if I pick 17pt, I get 22pt+, and if I pick 7pt, I get 
> 12pt+.  The compliance page says that the property is fully implemented.  
> So why am I getting this 5pt+ discrepancy?

I think I've figured out the formula FOP uses.  I'm quite sure it's wrong; 
the height of the block should simply be line-height, if specified in 
length, or as a multiplier of the font-size, if specified dimensionless.

It seems to be:
Diff(Ascender,Descender)*font-size/1000 + (line-height - font-size)

Where font-size and line-height are both specified in points.

I'll use this formula for now, but would appreciate any feedback.

-Adam



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