Hi Lea,

Thomas DeWeese | CDG Advanced Development | 
Eastman Kodak Company | 343 State Street | Rochester, NY 14650-0128 | 
[EMAIL PROTECTED] | 585 781-9059 | 
www.kodak.com 


Lea Thurman <[EMAIL PROTECTED]> wrote on 06/05/2008 05:24:12 AM:

> I am hijacking the thread a little but I am surprised by the size of the
> resulting PDF. Its seems that each font I reference or embed akes up 
about
> 300K per page in the resulting PDF file. A 2 page PDF with 2 referenced
> fonts generates a 1.1MB PDF, without fonts it is 84K.

   Unfortunately this is not too surprising for me.

> Does this seem normal to you? I suspect that because I am using FOP to 
to
> render a number of SVG documents generated by batik and each SVG 
document
> has the same referenced fonts then the PDF transcoder is duplicating the
> fonts for each page.

    No it's worse than that.  The capabilities of an SVG font are much
greater than the capabilities of a PDF font. Each glyph can at least in
theory make use of all of the features of SVG, multiple colors, stroking,
filters, animation... (I don't think we support animated fonts BTW, but
the spec does).  So there is no usage of PDF fonts when you use an SVG
Font, we simply draw the text (character) content in the PDF.  So if
'e' is present a bazillion times in the document there will be a 
bazillion copies of the data for the 'e' glyph.

> Failing this we are going to try and remove FOP from the equation and 
amend
> batik to support multiple pages via the nextPage() method.

   This won't help the file size problem.

> Jeremias Maerki-2 wrote:
> > 
> > Sorry for the delay. I seemed to have missed this.
> > 
> > My suspicion is that the "No ImagePreloader found" is only a follow-up
> > error of an error thrown when parsing the SVG. Are there no other 
error
> > messages before the above error in the log? Lea, would you send me 
your
> > SVG font file you referenced in your testfile below so I don't have to
> > spend too much time trying to set up the same testcase? I'm not too
> > familiar with SVG fonts. I will then try to reproduce the problem ASAP
> > so I can provide better feedback. Otherwise, please try to set this up
> > for debugging and try to figure out by
> > org.apache.fop.image.loader.batik.PreloaderSVG fails to recognize your
> > SVG as a valid SVG file.
> > 
> > On 02.06.2008 18:04:40 Lea Thurman wrote:
> >> 
> >> Hi,
> >> 
> >> I am using batik 1.7 to render an SVG document. I then create a FOP
> >> document
> >> and reference the generated SVG which is then converted into PDF 
using
> >> FOP
> >> 0.95beta.  The FOP document is below (but I suspect not the issue):
> >> 
> >> <?xml version="1.0" encoding="utf-8"?>
> >> <fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format";
> >> xmlns:fox="http://xmlgraphics.apache.org/fop/extensions";>
> >>       <fo:layout-master-set>
> >>         <fo:simple-page-master master-name="A4-portrait"
> >> page-height="29.7cm" page-width="21.0cm" margin="2cm">
> >>           <fo:region-body/>
> >>         </fo:simple-page-master>
> >>       </fo:layout-master-set>
> >>       <fox:external-document id="img1"
> >> src="/Users/temp/project/page1.svg"/>
> >> </fo:root>
> >> 
> >> Everything has been working well until I attempted to reference an
> >> external
> >> font in the SVG file.
> >> 
> >> I get a 'No ImagePreloader found" error when I reference the SVG 
document
> >> below. The error seems to be as a result of the following SVG element
> >> which
> >> is referencing an external font file. I know the external font file 
is
> >> good
> >> since this can be converted successfully into PDF using the testcard
> >> characters. The SVG file is below:
> >> 
> >> <?xml version="1.0" standalone="yes"?>
> >> <svg width="400px" height="300px" version="1.1"
> >> xmlns='http://www.w3.org/2000/svg'> 
> >>  <defs>
> >>  <font-face font-family="Swiss721NarrowSWA">
> >>    <font-face-src>
> >>      <font-face-uri
> >> xlink:href="file:///Users/temp/project/myfont.svg#Font1"/>
> >>    </font-face-src> 
> >>  </font-face>
> >>  </defs>
> >> <g style="font-family: Swiss721NarrowSWA; font-size:18;fill:black"> 
> >>   <text x="20" y="120">@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_</text> 
> >> </g>
> >> </svg>
> >> 
> >> Everything works as expected if I embed the font into the SVG 
document
> >> rather than referencing it.
> >> 
> >> I am not sure if it is something I have done with Batik or it is a 
FOP
> >> error
> >> so I decided to post here first. Apologies if this is clearly a FOP
> >> problem
> >> however FOP is able to handle to conversion with an embedded font so
> >> maybe I
> >> have referenced the font incorrectly in SVG.
> >> 
> >> Any help would be much appreciated.
> >> 
> >> Regards
> >> Lea.
> >> -- 
> >> View this message in context:
> >> http://www.nabble.com/%22No-ImagePreloader-found%22-when-
> attempting-to-reference-external-font-tp17604859p17604859.html
> >> Sent from the Batik - Users mailing list archive at Nabble.com.
> >> 
> > 
> > 
> > 
> > Jeremias Maerki
> > 
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: 
[EMAIL PROTECTED]
> > 
> > 
> > 
> 
> -- 
> View this message in context: http://www.nabble.com/%22No-
> ImagePreloader-found%22-when-attempting-to-reference-external-font-
> tp17604859p17665735.html
> Sent from the Batik - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 

<<image/gif>>

Reply via email to