[prev in list] [next in list] [prev in thread] [next in thread] 

List:       fop-user
Subject:    Re: FOP 2.2 - loading fonts
From:       "Stefan Hegny (hydrografix Consulting GmbH)" <hegny () hydrografix ! com>
Date:       2017-07-05 21:14:59
Message-ID: d396d579-2be0-4c78-12aa-b9097accd38a () hydrografix ! com
[Download RAW message or body]

Hi J,
in newer FOP versions the metrics xml is no longer necessary, you could
try removing the metrics-url from the font entry
BR Stefan

On 05.07.2017 18:30, Jeno Forizs wrote:
> Hi guys,
>
> I got problems with loading fonts. fop.xml config got this definition
> of a font:
>     <font metrics-url="arial.xml"
>             kerning="yes"
>                 embed-url="arial.ttf">
>                 <font-triplet name="Arial" style="normal"
> weight="normal"/>
>         </font>
>
> When the PDF is rendered, there's an error message:
> "2017-07-05 18:13:10.508 ERROR 3120 --- [nio-6200-exec-1]
> org.apache.fop.pdf.PDFFactory            : Failed to embed font
> [org.apache.fop.fonts.LazyFont@2402f627{Arial
> Bold}{metrics-url=arialbd.xml,embed-url=arialbd.ttf,kerning=true,advanced=true}]
> Arial-BoldMT
>
> java.io.IOException: 'loca' table not found, happens when the font
> file doesn't contain TrueType outlines (trying to read an OpenType CFF
> font maybe?)
>         at
> org.apache.fop.fonts.truetype.TTFFile.readIndexToLocation(TTFFile.java:180)
>         at
> org.apache.fop.fonts.truetype.TTFSubSetFile.readFont(TTFSubSetFile.java:479)
>         at
> org.apache.fop.pdf.PDFFactory.getFontSubsetBytes(PDFFactory.java:1368)
>         at
> org.apache.fop.pdf.PDFFactory.makeFontFile(PDFFactory.java:1299)
>         at
> org.apache.fop.pdf.PDFFactory.makeFontDescriptor(PDFFactory.java:1223)
>         at org.apache.fop.pdf.PDFFactory.makeFont(PDFFactory.java:944)
>         at
> org.apache.fop.pdf.PDFResources.addFonts(PDFResources.java:137)"
>
> When I configure FOP to autodetect the installed fonts of the
> operating system, then of course all installed fonts are discovered
> and they are available for using them in the PDFs - included this
> arial.ttf which loading is broken with the error above. (anyway, this
> setup of this font has been working with FOP 0.95)
>
> Why do I want to specify and load fonts via fop.xml? Because the
> application is a spring-boot app and it's going to run in a docker
> image where noone knows what kinda fonts will be installed and if they
> would be accessible to FOP.
>
> Any ideas how could I configure the font loading properly?
>
> Thanks,
> J.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
>
>


-- 

Stefan Hegny, Geschäftsführer/Manager
hydrografix Consulting GmbH       hegny@hydrografix.com
Tel. +49 - 173-3257674            Fax +49 - 6106-772614
Görlitzer Str. 13
D-63110 Rodgau                    Amtsgericht Offenbach/Main HRB 43974
Geschäftsführer: Roland Junker, Stefan Hegny


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

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic