[ https://issues.apache.org/jira/browse/FOP-2611?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15339534#comment-15339534 ]
Glenn Adams commented on FOP-2611: ---------------------------------- Yes. Note that the fix was applied to the trunk of the FOP source tree, and not to either 2.0 or 2.1 builds. > Fonts in the class path makes fonts listing fail > ------------------------------------------------ > > Key: FOP-2611 > URL: https://issues.apache.org/jira/browse/FOP-2611 > Project: FOP > Issue Type: Bug > Components: font/unqualified > Affects Versions: 2.1 > Environment: $ uname -a > Linux - 3.16.0-73-generic #95~14.04.1-Ubuntu SMP Thu Jun 9 08:00:04 UTC 2016 > x86_64 x86_64 x86_64 GNU/Linux > $ java -version > java version "1.8.0_77" > Java(TM) SE Runtime Environment (build 1.8.0_77-b03) > Java HotSpot(TM) 64-Bit Server VM (build 25.77-b03, mixed mode) > Reporter: Maxime Bégnis > > When using fonts embedded in a .jar file in the class path > (https://xmlgraphics.apache.org/fop/2.1/fonts.html#autodetect), fonts listing > fails with this exception: > org.apache.fop.cli.Main startFOP > GRAVE: Exception > java.lang.IllegalArgumentException: URI is not hierarchical > at java.io.File.<init>(File.java:418) > at org.apache.fop.fonts.FontCache.addFont(FontCache.java:335) > at > org.apache.fop.fonts.autodetect.FontInfoFinder.getFontInfoFromCustomFont(FontInfoFinder.java:157) > at > org.apache.fop.fonts.autodetect.FontInfoFinder.find(FontInfoFinder.java:269) > at org.apache.fop.fonts.FontAdder.add(FontAdder.java:63) > at > org.apache.fop.fonts.FontDetectorFactory$DefaultFontDetector.detect(FontDetectorFactory.java:110) > at org.apache.fop.fonts.FontManager.autoDetectFonts(FontManager.java:229) > at > org.apache.fop.fonts.DefaultFontConfigurator.configure(DefaultFontConfigurator.java:82) > at > org.apache.fop.render.PrintRendererConfigurator.getCustomFontCollection(PrintRendererConfigurator.java:147) > at > org.apache.fop.render.PrintRendererConfigurator.setupFontInfo(PrintRendererConfigurator.java:127) > at org.apache.fop.render.intermediate.IFUtil.setupFonts(IFUtil.java:170) > at > org.apache.fop.render.intermediate.IFRenderer.setupFontInfo(IFRenderer.java:187) > at org.apache.fop.area.RenderPagesModel.<init>(RenderPagesModel.java:75) > at > org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135) > at org.apache.fop.area.AreaTreeHandler.<init>(AreaTreeHandler.java:105) > at > org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:350) > at org.apache.fop.fo.FOTreeBuilder.<init>(FOTreeBuilder.java:107) > at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:104) > at org.apache.fop.apps.Fop.<init>(Fop.java:78) > at org.apache.fop.apps.FOUserAgent.newFop(FOUserAgent.java:182) > at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:107) > at org.apache.fop.cli.Main.startFOP(Main.java:186) > at org.apache.fop.cli.Main.main(Main.java:217) > Steps to reproduce: > 1. delete FOP's fonts cache (on Linux: "~/.fop/fop-fonts.cache") > 2. include a .jar file containing a font as described in > https://xmlgraphics.apache.org/fop/2.1/fonts.html#autodetect > in the FOP's class path > 3. run FOP > I found a way around this by using a custom resolver that will discard any > "jar: ..." URI. > I use fonts in a jar file for them to be taken into account by JEuclid (I > didn't find any other way so far). > I finally made this work by duplicating the fonts in the jar file in a > regular folder (so I must maintain 2 copies of each file). -- This message was sent by Atlassian JIRA (v6.3.4#6332)