RE: Are variable OpenType fonts supported in FOP 2.9?
Hi, Inside the notosans zip there is a static folder with separate font weights. Thanks -Original Message- From: Klaus Malorny Sent: 24 April 2024 11:59 To: fop-users@xmlgraphics.apache.org Subject: Are variable OpenType fonts supported in FOP 2.9? Hi, just a short question whether this is simply not support or whether I make some mistakes: Are variable OpenType fonts using variable axes (like weight, width or slant) supported by FOP 2.9? Specifically, I want to use the NotoSans font family, and at least at Google's own site (fonts.google.com), the latest versions seem to be only available as variable fonts and not as separate files for the various weights. Thanks in advance & greetings Klaus - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Are variable OpenType fonts supported in FOP 2.9?
Hi, just a short question whether this is simply not support or whether I make some mistakes: Are variable OpenType fonts using variable axes (like weight, width or slant) supported by FOP 2.9? Specifically, I want to use the NotoSans font family, and at least at Google's own site (fonts.google.com), the latest versions seem to be only available as variable fonts and not as separate files for the various weights. Thanks in advance & greetings Klaus - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Setting renderer merge-fonts from code
Iâll answer my own question đ userAgent.getRendererOptions().put( PDFRendererOption.MERGE_FONTS.getName(), true ); Feels a bit odd because youâre not telling it which renderer, but works for our flow. Had tried just PDFRendererOption.MERGE_FONTS previously, but simple string name is needed. Mark From: Mark Gibson Sent: 22 August 2022 22:57 To: fop-users@xmlgraphics.apache.org Subject: Setting renderer merge-fonts from code Hi. Iâm sure Iâm missing something simple, but Iâm looking to set the âmerge-fontsâ configuration via code on the FOUserAgent. And Iâm failing. Iâve found how to read it, but thereâs no setters: PDFRendererConfig rcfg = (PDFRendererConfig)userAgent.getRendererConfig( "application/pdf", new PDFRendererConfig.PDFRendererConfigParser() ); PDFRendererOptionsConfig rocfg = rcfg.getConfigOptions(); rocfg.getMergeFontsEnabled(); Does anyone know the magic? Thanks Mark
Setting renderer merge-fonts from code
Hi. I'm sure I'm missing something simple, but I'm looking to set the "merge-fonts" configuration via code on the FOUserAgent. And I'm failing. I've found how to read it, but there's no setters: PDFRendererConfig rcfg = (PDFRendererConfig)userAgent.getRendererConfig( "application/pdf", new PDFRendererConfig.PDFRendererConfigParser() ); PDFRendererOptionsConfig rocfg = rcfg.getConfigOptions(); rocfg.getMergeFontsEnabled(); Does anyone know the magic? Thanks Mark
RE: Fop fails to resolve embedded fonts after update from 2.6 to 2.7
I had the same problem when changing to fop 2.7. The problem is that the font-manager doesn't honor the custom resource resolver passed to the fop builder anymore. I described a workaround in https://issues.apache.org/jira/browse/FOP-2861?attachmentSortBy=dateTime Basically with 2.7 you need to extra pass your resource solver to the font-manager. On 2022/08/07 11:56:33 Stefan Kleinbaum wrote: > Hi! > > I've googled for breaking changes of an apache fop 2.6 -> 2.7 update, but I > have got nowhere. > > After a fop update from 2.6 to 2.7, my application fails to resolve > embedded font files from the jar classpath. A resolver is registered at > "new FopFactoryBuilder(new File(".").toURI(), resolver)", > "transformerFactory.setUriResolver(resolver)" and > "transformer.setURIResolver(resolver)" but get's not called on embedded > fonts. However, this stacktrace is printed: > > SEVERE: Failed to read font file myProject/fonts/myFont.ttf (No such file > or directory) > java.io.FileNotFoundException: File("."))>/myProject/fonts/myFont.ttf (No such file or directory) > at java.io.FileInputStream.open0(Native Method) > at java.io.FileInputStream.open(FileInputStream.java:195) > at java.io.FileInputStream.(FileInputStream.java:138) > at java.io.FileInputStream.(FileInputStream.java:93) > at > sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) > at > sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) > at java.net.URL.openStream(URL.java:1045) > at > org.apache.fop.apps.io.ResourceResolverFactory - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hello, to validate the hypothesis you could modify by hand the PDF by changing the name of the fonts in the tags /FontName and /BaseFont to a pattern used for embedded subset like A+xx (the value of xx is not important) without adding nor removing any byte from the PDF. If this solves the issue maybe a patch to font name generation is needed for embedded subsets. Best regards. Il giorno mar 16 ago 2022 alle ore 20:45 ha scritto: > Hi, > > > > If I am able to source a iOS/mac device at work, I will look into this. > > > > Thanks > > > > *From:* Mark Gibson > *Sent:* 16 August 2022 16:56 > *To:* fop-users@xmlgraphics.apache.org > *Subject:* RE: Corrupt font display on iOS when using PDF-Images with > merge-fonts=true > > > > Hi Luca > > > > We have no control over the source PDF being embedded. They are often > (but not always) exported as PDF from Excel. And done by our clients, not > us. > > > > Do we have any other options? Either via fixups to FOP or bug > notifications to iOS browsers (Iâm gonna guess chromium). > > > > Thanks > > Mark > > > > *From:* Luca Bellonda > *Sent:* 16 August 2022 14:47 > *To:* fop-users@xmlgraphics.apache.org > *Subject:* Re: Corrupt font display on iOS when using PDF-Images with > merge-fonts=true > > > > [EXTERNAL] > > > > Hello the PDF is visible on Linux viewers and browsers, but the fonts are > embedded as subset in both the source PDFs and as fully embedded in the > final PDF with the fonts merged. > > The name of the font in the source pdf for example is BCDEEE+Calibri-Bold, > compatible with embedded subsets (6 chars and a plus sign). > > The name of the font in the merged file is Calibri-Bold, which should > identify it as fully embedded. > > I guess the wrong viewer is not able to deal with the character decoding, > thinking to use a fully embedded font. > > Please, try generating the source PDFs embedding the whole fonts and not a > subset. > > > > > > lb > > > > > > Il giorno mar 16 ago 2022 alle ore 13:13 Mark Gibson < > mark.gib...@staff.bluematrix.com> ha scritto: > > > > https://issues.apache.org/jira/browse/FOP-3089 > > > > Viewing in Windows browsers is fine > > Viewing in iOS browsers is corrupt > > Viewing in Adobe app on iOS and windows is fine > > Apologies, no access to Linux devices to test viewing > > > > Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10) > > > >
RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hi, If I am able to source a iOS/mac device at work, I will look into this. Thanks From: Mark Gibson Sent: 16 August 2022 16:56 To: fop-users@xmlgraphics.apache.org Subject: RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true Hi Luca We have no control over the source PDF being embedded. They are often (but not always) exported as PDF from Excel. And done by our clients, not us. Do we have any other options? Either via fixups to FOP or bug notifications to iOS browsers (Iâm gonna guess chromium). Thanks Mark From: Luca Bellonda mailto:lbello...@gmail.com> > Sent: 16 August 2022 14:47 To: fop-users@xmlgraphics.apache.org <mailto:fop-users@xmlgraphics.apache.org> Subject: Re: Corrupt font display on iOS when using PDF-Images with merge-fonts=true [EXTERNAL] Hello the PDF is visible on Linux viewers and browsers, but the fonts are embedded as subset in both the source PDFs and as fully embedded in the final PDF with the fonts merged. The name of the font in the source pdf for example is BCDEEE+Calibri-Bold, compatible with embedded subsets (6 chars and a plus sign). The name of the font in the merged file is Calibri-Bold, which should identify it as fully embedded. I guess the wrong viewer is not able to deal with the character decoding, thinking to use a fully embedded font. Please, try generating the source PDFs embedding the whole fonts and not a subset. lb Il giorno mar 16 ago 2022 alle ore 13:13 Mark Gibson mailto:mark.gib...@staff.bluematrix.com> > ha scritto: https://issues.apache.org/jira/browse/FOP-3089 Viewing in Windows browsers is fine Viewing in iOS browsers is corrupt Viewing in Adobe app on iOS and windows is fine Apologies, no access to Linux devices to test viewing Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10)
RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hi Luca We have no control over the source PDF being embedded. They are often (but not always) exported as PDF from Excel. And done by our clients, not us. Do we have any other options? Either via fixups to FOP or bug notifications to iOS browsers (Iâm gonna guess chromium). Thanks Mark From: Luca Bellonda Sent: 16 August 2022 14:47 To: fop-users@xmlgraphics.apache.org Subject: Re: Corrupt font display on iOS when using PDF-Images with merge-fonts=true [EXTERNAL] Hello the PDF is visible on Linux viewers and browsers, but the fonts are embedded as subset in both the source PDFs and as fully embedded in the final PDF with the fonts merged. The name of the font in the source pdf for example is BCDEEE+Calibri-Bold, compatible with embedded subsets (6 chars and a plus sign). The name of the font in the merged file is Calibri-Bold, which should identify it as fully embedded. I guess the wrong viewer is not able to deal with the character decoding, thinking to use a fully embedded font. Please, try generating the source PDFs embedding the whole fonts and not a subset. lb Il giorno mar 16 ago 2022 alle ore 13:13 Mark Gibson mailto:mark.gib...@staff.bluematrix.com>> ha scritto: https://issues.apache.org/jira/browse/FOP-3089 Viewing in Windows browsers is fine Viewing in iOS browsers is corrupt Viewing in Adobe app on iOS and windows is fine Apologies, no access to Linux devices to test viewing Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10)
Re: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hello the PDF is visible on Linux viewers and browsers, but the fonts are embedded as subset in both the source PDFs and as fully embedded in the final PDF with the fonts merged. The name of the font in the source pdf for example is BCDEEE+Calibri-Bold, compatible with embedded subsets (6 chars and a plus sign). The name of the font in the merged file is Calibri-Bold, which should identify it as fully embedded. I guess the wrong viewer is not able to deal with the character decoding, thinking to use a fully embedded font. Please, try generating the source PDFs embedding the whole fonts and not a subset. lb Il giorno mar 16 ago 2022 alle ore 13:13 Mark Gibson < mark.gib...@staff.bluematrix.com> ha scritto: > > > https://issues.apache.org/jira/browse/FOP-3089 > > > > Viewing in Windows browsers is fine > > Viewing in iOS browsers is corrupt > > Viewing in Adobe app on iOS and windows is fine > > Apologies, no access to Linux devices to test viewing > > > > Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10) > > >
RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Thanks Simon https://issues.apache.org/jira/browse/FOP-3089 Viewing in Windows browsers is fine Viewing in iOS browsers is corrupt Viewing in Adobe app on iOS and windows is fine Apologies, no access to Linux devices to test viewing Same issue occurs when running FOP 2.7 on Linux (CentOS) and Windows (10) Thanks Mark From: Simon Steiner Sent: 16 August 2022 10:55 To: fop-users@xmlgraphics.apache.org Subject: RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true [EXTERNAL] Hi, Can you open a bug on jira, can you replicate on windows or linux pdf viewers? Thanks From: Mark Gibson mailto:mark.gib...@staff.bluematrix.com>> Sent: 15 August 2022 18:18 To: fop-users@xmlgraphics.apache.org<mailto:fop-users@xmlgraphics.apache.org> Subject: Corrupt font display on iOS when using PDF-Images with merge-fonts=true Hi We have an issue when using PDF-Images plugin to inject a PDF as an image. All PDFs are rendered with fonts embedded. When we set merge-fonts config to false, the rendered PDF displays fine in all tested viewers However, when we set merge-fonts config to true, the rendered PDF is corrupt when viewed in-browser on IOS devices (currently tested browsers include Safari, Chrome, and DuckDuckGo, latest IOS and browsers). Strangely, when viewed in Adobe iOS app, the PDF is displayed fine. The corruption is in the font display, making embedded textual tables unreadable. I don't know enough about PDF + fonts + viewers to be able to figure out if there's a universal iOS PDF in-browser viewer error, or whether the merge-fonts process somehow corrupts the resultant PDF (in a weird way that means some viewers work, whilst some don't) Adobe Acrobat Pro DC file comparison shows zero differences between the two rendered PDFs. I've attempted to attach a zip containing the fo, embedded pdf, two fop configs, and the two fonts in use. Hopefully it won't be stripped Commands to render the two PDFs are as follows (run from the root directory of the attached archive): * .../fop.bat -fo pdf-images.fo -c fop.xml -pdf pdf-images.pdf * .../fop.bat -fo pdf-images.fo -c fop-mergefonts.xml -pdf pdf-images-mergefonts.pdf Hopefully someone will at least be able to give some direction for this. The merge-fonts config is a game changer for us as it massively shrinks the size of many of the PDFs we render. Thanks Mark
RE: Corrupt font display on iOS when using PDF-Images with merge-fonts=true
Hi, Can you open a bug on jira, can you replicate on windows or linux pdf viewers? Thanks From: Mark Gibson Sent: 15 August 2022 18:18 To: fop-users@xmlgraphics.apache.org Subject: Corrupt font display on iOS when using PDF-Images with merge-fonts=true Hi We have an issue when using PDF-Images plugin to inject a PDF as an image. All PDFs are rendered with fonts embedded. When we set merge-fonts config to false, the rendered PDF displays fine in all tested viewers However, when we set merge-fonts config to true, the rendered PDF is corrupt when viewed in-browser on IOS devices (currently tested browsers include Safari, Chrome, and DuckDuckGo, latest IOS and browsers). Strangely, when viewed in Adobe iOS app, the PDF is displayed fine. The corruption is in the font display, making embedded textual tables unreadable. I don't know enough about PDF + fonts + viewers to be able to figure out if there's a universal iOS PDF in-browser viewer error, or whether the merge-fonts process somehow corrupts the resultant PDF (in a weird way that means some viewers work, whilst some don't) Adobe Acrobat Pro DC file comparison shows zero differences between the two rendered PDFs. I've attempted to attach a zip containing the fo, embedded pdf, two fop configs, and the two fonts in use. Hopefully it won't be stripped Commands to render the two PDFs are as follows (run from the root directory of the attached archive): * ./fop.bat -fo pdf-images.fo -c fop.xml -pdf pdf-images.pdf * ./fop.bat -fo pdf-images.fo -c fop-mergefonts.xml -pdf pdf-images-mergefonts.pdf Hopefully someone will at least be able to give some direction for this. The merge-fonts config is a game changer for us as it massively shrinks the size of many of the PDFs we render. Thanks Mark
Fop fails to resolve embedded fonts after update from 2.6 to 2.7
Hi! I've googled for breaking changes of an apache fop 2.6 -> 2.7 update, but I have got nowhere. After a fop update from 2.6 to 2.7, my application fails to resolve embedded font files from the jar classpath. A resolver is registered at "new FopFactoryBuilder(new File(".").toURI(), resolver)", "transformerFactory.setUriResolver(resolver)" and "transformer.setURIResolver(resolver)" but get's not called on embedded fonts. However, this stacktrace is printed: SEVERE: Failed to read font file myProject/fonts/myFont.ttf (No such file or directory) java.io.FileNotFoundException: /myProject/fonts/myFont.ttf (No such file or directory) at java.io.FileInputStream.open0(Native Method) at java.io.FileInputStream.open(FileInputStream.java:195) at java.io.FileInputStream.(FileInputStream.java:138) at java.io.FileInputStream.(FileInputStream.java:93) at sun.net.www.protocol.file.FileURLConnection.connect(FileURLConnection.java:90) at sun.net.www.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:188) at java.net.URL.openStream(URL.java:1045) at org.apache.fop.apps.io.ResourceResolverFactory$NormalResourceResolver.getResource(ResourceResolverFactory.java:224) at org.apache.fop.apps.io.ResourceResolverFactory$TempAwareResourceResolver.getResource(ResourceResolverFactory.java:152) at org.apache.fop.apps.io.ResourceResolverFactory$DefaultResourceResolver.getResource(ResourceResolverFactory.java:121) at org.apache.fop.apps.io.InternalResourceResolver.getResource(InternalResourceResolver.java:92) at org.apache.fop.fonts.truetype.OFFontLoader.read(OFFontLoader.java:113) at org.apache.fop.fonts.truetype.OFFontLoader.read(OFFontLoader.java:103) at org.apache.fop.fonts.FontLoader.getFont(FontLoader.java:126) at org.apache.fop.fonts.FontLoader.loadFont(FontLoader.java:110) at org.apache.fop.fonts.LazyFont.load(LazyFont.java:121) at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:237) at org.apache.fop.fonts.Font.getAscender(Font.java:120) at org.apache.fop.layoutmgr.BlockLayoutManager.initialize(BlockLayoutManager.java:82) at org.apache.fop.layoutmgr.AbstractLayoutManager.getChildLM(AbstractLayoutManager.java:118) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:108) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:69) at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:252) at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:675) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:179) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:159) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:385) at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:113) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:143) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267) at org.apache.fop.fo.DelegatingFOEventHandler.endPageSequence(DelegatingFOEventHandler.java:114) at org.apache.fop.accessibility.fo.FO2StructureTreeConverter.endPageSequence(FO2StructureTreeConverter.java:184) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:140) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:390) at org.apache.fop.fo.FOTreeBuilder$3.run(FOTreeBuilder.java:207) at org.apache.fop.fo.FOTreeBuilder$3.run(FOTreeBuilder.java:204) at java.security.AccessController.doPrivileged(Native Method) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:203) at org.apache.xml.serializer.ToXMLSAXHandler.endElement(ToXMLSAXHandler.java:263) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1401) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemLiteralResult.execute(ElemLiteralResult.java:1376) at org.apache.xalan.templates.ElemApplyTemplates.transformSelectedNodes(ElemApplyTemplates.java:395) at org.apache.xalan.templates.ElemApplyTemplates.execute(ElemApplyTemplates.java:178) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.templates.ElemChoose.execute(ElemChoose.java:141) at org.apache.xalan.transformer.TransformerImpl.executeChildTemplates(TransformerImpl.java:2402) at org.apache.xalan.transformer.TransformerImpl.applyTemplateToNode(TransformerImpl.java:2272) at org.apache.xalan.transformer.TransformerImpl.transformNode(TransformerImpl.java:1358) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:711) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1275) at org.apache.xalan.transformer.TransformerImpl.transform(TransformerImpl.java:1253) How can I reenable font resolving in fop 2.7? Thanks Stefan
Re: Using Various Fonts to Achieve Multiple Languages Sometimes Results in Errors
Hi, You shouldn't be seeing that error. If you can share the fonts you configured then please log a bug with XSL-FO attached with fonts and fop.xconf file Thanks, Chris On 16/02/2021 15:43, Martin Furek wrote: I think I didn't explain myself well. I need to support multiple languages with mixed text (latin in Chinese and other way around). I never know beforehand where the text is. This works with multiple fonts, but sometimes throws an error as in the text that I already mentioned. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org . - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Using Various Fonts to Achieve Multiple Languages Sometimes Results in Errors
I think I didn't explain myself well. I need to support multiple languages with mixed text (latin in Chinese and other way around). I never know beforehand where the text is. This works with multiple fonts, but sometimes throws an error as in the text that I already mentioned. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Using Various Fonts to Achieve Multiple Languages Sometimes Results in Errors
Hi, I use oXygen ti edit my documents, with the Noto fonts and I get correct printing; see: https://git.yojik.eu/eric/FSI-Chinese-docbook/src/master/out/pdf/FSI-Chinese.pdf So it "works". I use Linux; I made a custom layer with this: excerpt from my: framework/docbook/xsl/fo/mon-docbook-chinois.xsl It's my version of: framework/docbook/xsl/fo/docbook_custom.xsl #FF 1.3em #FF * I too configure the ./lib/fop.xconf to include the path of my fonts * ./ file:/home/eric/.loca/share/fonts flate recursive="true">/home/eric/.local/share/fonts * Hope this help Eric Le 16/02/2021 Ă 15:13, Martin Furek a ĂŠcrit : I am using multiple fonts SansSerif,NotoSans,NotoSansCJK,Symbola to get Chinese, Greek and Emoji characters. When I try to print a fop that contains these following characters, I get an error. How should I achieve the printing in multiple languages? Text to Print: "typeđhttps://t.co/123 https://t.co/456"; Error: Feb. 16, 2021 3:02:48 NACHM. org.apache.fop.cli.Main startFOP SEVERE: Exception org.apache.fop.apps.FOPException: java.lang.ArrayIndexOutOfBoundsException: Index 13 out of bounds for length 13 java.lang.ArrayIndexOutOfBoundsException: Index 13 out of bounds for length 13 at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:296) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:116) at org.apache.fop.cli.Main.startFOP(Main.java:183) at org.apache.fop.cli.Main.main(Main.java:214) Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 13 out of bounds for length 13 at org.apache.fop.fonts.GlyphMapping.processWordMapping(GlyphMapping.java:172) at org.apache.fop.fonts.GlyphMapping.doGlyphMapping(GlyphMapping.java:92) at org.apache.fop.layoutmgr.inline.TextLayoutManager.processWord(TextLayoutManager.java:960) at org.apache.fop.layoutmgr.inline.TextLayoutManager.getNextKnuthElements(TextLayoutManager.java:819) at org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements(LineLayoutManager.java:698) at org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:627) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextChildElements(BlockLayoutManager.java:141) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:292) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:113) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:105) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextChildElements(FlowLayoutManager.java:223) at org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:148) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:116) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:69) at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:252) at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:675) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:179) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:159) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:385) at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:113) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:143) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:139) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:362) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentS
Using Various Fonts to Achieve Multiple Languages Sometimes Results in Errors
I am using multiple fonts SansSerif,NotoSans,NotoSansCJK,Symbola to get Chinese, Greek and Emoji characters. When I try to print a fop that contains these following characters, I get an error. How should I achieve the printing in multiple languages? Text to Print: "typeđhttps://t.co/123 https://t.co/456"; Error: Feb. 16, 2021 3:02:48 NACHM. org.apache.fop.cli.Main startFOP SEVERE: Exception org.apache.fop.apps.FOPException: java.lang.ArrayIndexOutOfBoundsException: Index 13 out of bounds for length 13 java.lang.ArrayIndexOutOfBoundsException: Index 13 out of bounds for length 13 at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:296) at org.apache.fop.cli.InputHandler.renderTo(InputHandler.java:116) at org.apache.fop.cli.Main.startFOP(Main.java:183) at org.apache.fop.cli.Main.main(Main.java:214) Caused by: java.lang.ArrayIndexOutOfBoundsException: Index 13 out of bounds for length 13 at org.apache.fop.fonts.GlyphMapping.processWordMapping(GlyphMapping.java:172) at org.apache.fop.fonts.GlyphMapping.doGlyphMapping(GlyphMapping.java:92) at org.apache.fop.layoutmgr.inline.TextLayoutManager.processWord(TextLayoutManager.java:960) at org.apache.fop.layoutmgr.inline.TextLayoutManager.getNextKnuthElements(TextLayoutManager.java:819) at org.apache.fop.layoutmgr.inline.LineLayoutManager.collectInlineKnuthElements(LineLayoutManager.java:698) at org.apache.fop.layoutmgr.inline.LineLayoutManager.getNextKnuthElements(LineLayoutManager.java:627) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextChildElements(BlockLayoutManager.java:141) at org.apache.fop.layoutmgr.BlockStackingLayoutManager.getNextKnuthElements(BlockStackingLayoutManager.java:292) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:113) at org.apache.fop.layoutmgr.BlockLayoutManager.getNextKnuthElements(BlockLayoutManager.java:105) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextChildElements(FlowLayoutManager.java:223) at org.apache.fop.layoutmgr.FlowLayoutManager.addChildElements(FlowLayoutManager.java:148) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:116) at org.apache.fop.layoutmgr.FlowLayoutManager.getNextKnuthElements(FlowLayoutManager.java:69) at org.apache.fop.layoutmgr.PageBreaker.getNextKnuthElements(PageBreaker.java:252) at org.apache.fop.layoutmgr.AbstractBreaker.getNextBlockList(AbstractBreaker.java:675) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:179) at org.apache.fop.layoutmgr.PageBreaker.getNextBlockList(PageBreaker.java:159) at org.apache.fop.layoutmgr.AbstractBreaker.doLayout(AbstractBreaker.java:385) at org.apache.fop.layoutmgr.PageBreaker.doLayout(PageBreaker.java:113) at org.apache.fop.layoutmgr.PageSequenceLayoutManager.activateLayout(PageSequenceLayoutManager.java:143) at org.apache.fop.area.AreaTreeHandler.endPageSequence(AreaTreeHandler.java:267) at org.apache.fop.fo.pagination.PageSequence.endOfNode(PageSequence.java:139) at org.apache.fop.fo.FOTreeBuilder$MainFOHandler.endElement(FOTreeBuilder.java:362) at org.apache.fop.fo.FOTreeBuilder.endElement(FOTreeBuilder.java:190) at org.apache.xalan.transformer.TransformerIdentityImpl.endElement(TransformerIdentityImpl.java:1102) at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source) at org.apache.xerces.xinclude.XIncludeHandler.endElement(Unknown Source) at org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanEndElement(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source) at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source) at org.apache.xerces.parsers.XMLParser.parse(Unknown Source) at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source) at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source) at org.apache.xalan.transformer.TransformerIdentityImpl.transform(TransformerIdentityImpl.java:485) at org.apache.fop.cli.InputHandler.transformTo(InputHandler.java:293) ... 3 more - java.lang.ArrayIndexOutOfBoundsException: Index 13 out of bounds for length 13 at org.apache.fop.fonts.GlyphMapping.processWordMapping(GlyphMapping.java:172) at org.apache.fop.fonts.GlyphMapping.doGlyphMapping(GlyphMapping.java:92) at org.apache.fop.layoutmgr.inline.TextLayoutManager.processWord(TextLayoutManager.java:960)
RE: Embedding Apache FOP 2.4: auto detect fonts without reading a config-file
Hi, Something like: String fopxconf = "xxx"; FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI(), new ByteArrayInputStream(fopxconf.getBytes())); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); Thanks -Original Message- From: Roman Steiner Sent: 08 February 2020 14:48 To: fop-users@xmlgraphics.apache.org Subject: Embedding Apache FOP 2.4: auto detect fonts without reading a config-file Hello, At the moment I try various things with the "ExampleFO2PDF < http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleFO2PDF.java?view=markup > ". Is it possible to set auto detecting fonts direct in the Java code without reading a config-file. Could someone give me an example of how this would work, if it is possible? Thanks, Roman - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Embedding Apache FOP 2.4: auto detect fonts without reading a config-file
Hello, At the moment I try various things with the "ExampleFO2PDF < http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleFO2PDF.java?view=markup > ". Is it possible to set auto detecting fonts direct in the Java code without reading a config-file. Could someone give me an example of how this would work, if it is possible? Thanks, Roman - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Embedding Apache FOP 2.4: auto detect fonts without reading a config-file
Hello, At the moment I try various things with the " ExampleFO2PDF <http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/fop/examples/embedding/java/embedding/ExampleFO2PDF.java?view=markup> ". Is it possible to set auto detecting fonts direct in the Java code without reading a config-file. Could someone give me an example of how this would work, if it is possible? Thanks, Roman -- Sent from: http://apache-fop.1065347.n5.nabble.com/FOP-Users-f3.html - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: How to render fonts as shape in Apache FOP 2.3
Apparently not: https://cwiki.apache.org/confluence/display/XMLGRAPHICSBATIK/PdfTranscoder On Tuesday, 3 September 2019, Schlatow, Sebastian < sebastian.schla...@cewe.de> wrote: > Hello, I also have asked this question on stackoverflow: > > https://stackoverflow.com/questions/57656624/how-to- > render-fonts-as-shape-in-apache-fop-2-3 > > But even there I have not yet received an answer. Is it not possible to > render fonts as curves / shapes anymore? > > > > Am Dienstag, den 27.08.2019, 07:55 + schrieb Schlatow, Sebastian: > > Hello, > > > > I want to update an old FOP 0.94 to the new FOP 2.3. In the old FOP > > fonts are rendered as shapes. I would like to preserve this behavior, > > so I tried to set the following to the PDFTranscoder.: > > > >PDFTranscoder pdfTranscoder = new PDFTranscoder(); > >pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, > > Boolean.TRUE); > > > > but if do that, no fonts are rendered in the outcoming PDF. > > > > If I remove: > > > >pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, > > Boolean.TRUE); > > > > then the text is in outcoming PDF, but not rendered as shape. > > > > How can I tell FOP to render fonts as shapes? > > > > > > > > Best regards > > > > Sebastian Schlatow > > > > > > CEWE Stiftung & Co. KGaA mit Sitz in Oldenburg; Registergericht > > Oldenburg HR B 208214; PersÜnlich haftende geschäftsfßhrende und > > vertretungsberechtigte Gesellschafterin: > > Neumßller CEWE COLOR Stiftung, Sitz: Oldenburg; > > Stiftungsverzeichnis der rechtsfähigen Stiftungen des bßrgerlichen > > Rechts im Bezirk der Regierungsvertretung Oldenburg Nummer 15(034). > > Stiftungsvorstand: > > Dr. Christian Friege (Vorsitzender), Patrick Berkhouwer, Dr. Reiner > > Fageth, Carsten Heitkamp, Dr. Olaf Holzkämper, Thomas Mehls, Frank > > Zweigle > > Aufsichtsrat: > > Otto Korte (Vorsitzender) > > UST ID-Nr. DE815453806; St.-Nr. 64/200/38999; GLN 40 04468 0 4 > > > CEWE Stiftung & Co. KGaA mit Sitz in Oldenburg; Registergericht Oldenburg > HR B 208214; PersÜnlich haftende geschäftsfßhrende und > vertretungsberechtigte Gesellschafterin: > Neumßller CEWE COLOR Stiftung, Sitz: Oldenburg; > Stiftungsverzeichnis der rechtsfähigen Stiftungen des bßrgerlichen Rechts > im Bezirk der Regierungsvertretung Oldenburg Nummer 15(034). > Stiftungsvorstand: > Dr. Christian Friege (Vorsitzender), Patrick Berkhouwer, Dr. Reiner > Fageth, Carsten Heitkamp, Dr. Olaf Holzkämper, Thomas Mehls, Frank Zweigle > Aufsichtsrat: > Otto Korte (Vorsitzender) > UST ID-Nr. DE815453806; St.-Nr. 64/200/38999; GLN 40 04468 0 4 > -- Matt Kynaston Lead Developer Tel: +441225851666 www.claritum.com Claritum Limited. Registered Office: Minerva House, Lower Bristol Road, Bath, BA2 9ER. Registered in England and Wales 3878694
Re: How to render fonts as shape in Apache FOP 2.3
Hello, I also have asked this question on stackoverflow: https://stackoverflow.com/questions/57656624/how-to-render-fonts-as-shape-in-apache-fop-2-3 But even there I have not yet received an answer. Is it not possible to render fonts as curves / shapes anymore? Am Dienstag, den 27.08.2019, 07:55 + schrieb Schlatow, Sebastian: > Hello, > > I want to update an old FOP 0.94 to the new FOP 2.3. In the old FOP > fonts are rendered as shapes. I would like to preserve this behavior, > so I tried to set the following to the PDFTranscoder.: > >PDFTranscoder pdfTranscoder = new PDFTranscoder(); >pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, > Boolean.TRUE); > > but if do that, no fonts are rendered in the outcoming PDF. > > If I remove: > >pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, > Boolean.TRUE); > > then the text is in outcoming PDF, but not rendered as shape. > > How can I tell FOP to render fonts as shapes? > > > > Best regards > > Sebastian Schlatow > > > CEWE Stiftung & Co. KGaA mit Sitz in Oldenburg; Registergericht > Oldenburg HR B 208214; PersÜnlich haftende geschäftsfßhrende und > vertretungsberechtigte Gesellschafterin: > Neumßller CEWE COLOR Stiftung, Sitz: Oldenburg; > Stiftungsverzeichnis der rechtsfähigen Stiftungen des bßrgerlichen > Rechts im Bezirk der Regierungsvertretung Oldenburg Nummer 15(034). > Stiftungsvorstand: > Dr. Christian Friege (Vorsitzender), Patrick Berkhouwer, Dr. Reiner > Fageth, Carsten Heitkamp, Dr. Olaf Holzkämper, Thomas Mehls, Frank > Zweigle > Aufsichtsrat: > Otto Korte (Vorsitzender) > UST ID-Nr. DE815453806; St.-Nr. 64/200/38999; GLN 40 04468 0 4 CEWE Stiftung & Co. KGaA mit Sitz in Oldenburg; Registergericht Oldenburg HR B 208214; PersÜnlich haftende geschäftsfßhrende und vertretungsberechtigte Gesellschafterin: Neumßller CEWE COLOR Stiftung, Sitz: Oldenburg; Stiftungsverzeichnis der rechtsfähigen Stiftungen des bßrgerlichen Rechts im Bezirk der Regierungsvertretung Oldenburg Nummer 15(034). Stiftungsvorstand: Dr. Christian Friege (Vorsitzender), Patrick Berkhouwer, Dr. Reiner Fageth, Carsten Heitkamp, Dr. Olaf Holzkämper, Thomas Mehls, Frank Zweigle Aufsichtsrat: Otto Korte (Vorsitzender) UST ID-Nr. DE815453806; St.-Nr. 64/200/38999; GLN 40 04468 0 4
Re: How to render fonts as shape in Apache FOP 2.3
We need that behavior to avoid complications in the production preprocessing. The software, which prepares the PDFs for the printing presses, needs the font as shapes. Am Dienstag, den 27.08.2019, 10:28 -0600 schrieb Warren Young: > On Aug 27, 2019, at 1:55 AM, Schlatow, Sebastian < > sebastian.schla...@cewe.de> wrote: > > fonts are rendered as shapes. I would like to preserve this > > behavior, > > You are *trying* to make your documents inaccessible to screen > readers, search engines, etc? Why? > > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: > fop-users-h...@xmlgraphics.apache.org > CEWE Stiftung & Co. KGaA mit Sitz in Oldenburg; Registergericht Oldenburg HR B 208214; PersÜnlich haftende geschäftsfßhrende und vertretungsberechtigte Gesellschafterin: Neumßller CEWE COLOR Stiftung, Sitz: Oldenburg; Stiftungsverzeichnis der rechtsfähigen Stiftungen des bßrgerlichen Rechts im Bezirk der Regierungsvertretung Oldenburg Nummer 15(034). Stiftungsvorstand: Dr. Christian Friege (Vorsitzender), Patrick Berkhouwer, Dr. Reiner Fageth, Carsten Heitkamp, Dr. Olaf Holzkämper, Thomas Mehls, Frank Zweigle Aufsichtsrat: Otto Korte (Vorsitzender) UST ID-Nr. DE815453806; St.-Nr. 64/200/38999; GLN 40 04468 0 4
Re: How to render fonts as shape in Apache FOP 2.3
On Aug 27, 2019, at 1:55 AM, Schlatow, Sebastian wrote: > > fonts are rendered as shapes. I would like to preserve this behavior, You are *trying* to make your documents inaccessible to screen readers, search engines, etc? Why? - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
How to render fonts as shape in Apache FOP 2.3
Hello, I want to update an old FOP 0.94 to the new FOP 2.3. In the old FOP fonts are rendered as shapes. I would like to preserve this behavior, so I tried to set the following to the PDFTranscoder.: PDFTranscoder pdfTranscoder = new PDFTranscoder(); pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, Boolean.TRUE); but if do that, no fonts are rendered in the outcoming PDF. If I remove: pdfTranscoder.addTranscodingHint(PDFTranscoder.KEY_STROKE_TEXT, Boolean.TRUE); then the text is in outcoming PDF, but not rendered as shape. How can I tell FOP to render fonts as shapes? Best regards Sebastian Schlatow CEWE Stiftung & Co. KGaA mit Sitz in Oldenburg; Registergericht Oldenburg HR B 208214; PersÜnlich haftende geschäftsfßhrende und vertretungsberechtigte Gesellschafterin: Neumßller CEWE COLOR Stiftung, Sitz: Oldenburg; Stiftungsverzeichnis der rechtsfähigen Stiftungen des bßrgerlichen Rechts im Bezirk der Regierungsvertretung Oldenburg Nummer 15(034). Stiftungsvorstand: Dr. Christian Friege (Vorsitzender), Patrick Berkhouwer, Dr. Reiner Fageth, Carsten Heitkamp, Dr. Olaf Holzkämper, Thomas Mehls, Frank Zweigle Aufsichtsrat: Otto Korte (Vorsitzender) UST ID-Nr. DE815453806; St.-Nr. 64/200/38999; GLN 40 04468 0 4
RE: Questions on Spanish fonts using FOP
Perhaps the font you are using doesnât exist in the linux dist or doesnât support certain characters. Try using a different font. One that you can be sure of supports the characters you are after. Can you give a screenshot of the garbage characters and write what font you are using? [excosoft] Excosoft ⢠Thomas SĂśrensen Cell +46 (0)76-199 3184 Email thomas.soren...@excosoft.se<mailto:thomas.soren...@excosoft.se> www.excosoft.se<http://www.excosoft.se/> From: Yash V Sent: 04 November 2018 18:01 To: fop-users@xmlgraphics.apache.org Subject: Questions on Spanish fonts using FOP Hello there, We are using FOP 0.20.5 to generate PDF documents that will be mailed to our customers. The FOP API is used within our custom java code. This solution was developed on our AIX servers 14 years ago and the solutions was working fine for both English and Spanish documents. In June 2017, we migrated our servers from AIX to Linux and we noticed couple months ago that our solution was printing junk characters for accented Spanish characters. As part of our troubleshooting and analysis, we did try our solution on Windows laptop and the solution with FOP 0.20.5 is printing the accented Spanish characters perfectly. However, the same is not true on our Linux servers. We tried to upgrade our FOP from 0.20.5 to 2.3 and we are still seeing the same behavior on Linux servers. Any pointers on the possible solution or reason for the behavior would help us a lot in troubleshooting and fixing the solution. FYI: Our logs does not indicate any FOP errors that point to an issue. -- Thanks & Regards, Yash. (Oracle Certified Workflow Expert)
Questions on Spanish fonts using FOP
Hello there, We are using FOP 0.20.5 to generate PDF documents that will be mailed to our customers. The FOP API is used within our custom java code. This solution was developed on our AIX servers 14 years ago and the solutions was working fine for both English and Spanish documents. In June 2017, we migrated our servers from AIX to Linux and we noticed couple months ago that our solution was printing junk characters for accented Spanish characters. As part of our troubleshooting and analysis, we did try our solution on Windows laptop and the solution with FOP 0.20.5 is printing the accented Spanish characters perfectly. However, the same is not true on our Linux servers. We tried to upgrade our FOP from 0.20.5 to 2.3 and we are still seeing the same behavior on Linux servers. Any pointers on the possible solution or reason for the behavior would help us a lot in troubleshooting and fixing the solution. FYI: Our logs does not indicate any FOP errors that point to an issue. -- Thanks & Regards, Yash. (Oracle Certified Workflow Expert)
Using Fonts included in JAR File
Hello Evrybody, I am trying to use some extra Fonts that are in a JAR File with FOP 2.2 - and it does not work :( Using that kinda config: It always tells me : Aug 30, 2017 4:05:43 PM org.apache.fop.fonts.LazyFont load SCHWERWIEGEND: Failed to read font metrics file null java.io.EOFException: Reached EOF, file size=97628 at org.apache.fop.fonts.truetype.FontFileReader.read(FontFileReader.java:100) at org.apache.fop.fonts.truetype.FontFileReader.readTTFUByte(FontFileReader.java:124) at org.apache.fop.fonts.truetype.FontFileReader.readTTFUShort(FontFileReader.java:152) at org.apache.fop.fonts.truetype.OpenFont.readHorizontalMetrics(OpenFont.java:1255) at org.apache.fop.fonts.truetype.OpenFont.readFont(OpenFont.java:735) at org.apache.fop.fonts.truetype.OFFontLoader.read(OFFontLoader.java:117) at org.apache.fop.fonts.truetype.OFFontLoader.read(OFFontLoader.java:101) at org.apache.fop.fonts.FontLoader.getFont(FontLoader.java:126) at org.apache.fop.fonts.FontLoader.loadFont(FontLoader.java:110) at org.apache.fop.fonts.LazyFont.load(LazyFont.java:121) at org.apache.fop.fonts.LazyFont.getAscender(LazyFont.java:238) at org.apache.fop.fonts.Font.getAscender(Font.java:118) What am I doing wrong? Thanks! Heiko -- Sent from: http://apache-fop.1065347.n5.nabble.com/FOP-Users-f3.html - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: To PDF/a Conversion without licensed fonts (java)
Hello, ah ok, I see, the afm files must be besides the PFM files. My ghostscript installation places them right in the same directory. Sorry I missed that BR, Stefan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Configuring for Fonts included within a Spring-Boot/Camel Microservice
Gerry, Several years ago I had the same problems with relative paths of font files on webapps with fop jar included (it was Apache Cocoon with FOP block and FOP jar). I experimenting alot but no success. Digging into the logs shows me very interesting thing, that for some reasons FOP within WAR required some fake dir to be existent within font-base. It is a very weird behavior, but anyway, I fixed this with the following. Try to repeat it step by step: 1. Put fop fonts files and fop conf under resources folder as the following: - fop.conf - fop-fonts/fop-fonts-glyphs/ 2. Add the following snippet in fop.conf (note about "fake" folder!): fop-fonts/fake 3. Add the following snippet to fop.conf in section: ...any font - glyph combination here - see below sample... 4. Try to run your app. So the full path would be wrong from logic point of view (fop-fonts/fake/fop-fonts-glyphs/liberation-sans-italic.ttf), but it works for some reasons! Of course, you can remove "fop-fonts-glyphs" dir respectively in step 1 and 3 to get fop-fonts/fake/liberation-sans-italic.ttf , but DON'T remove the mentioning the "fake" dir in font-base P.S. If you use standalone FOP this tricky stuff is not needed and all works as should be. After trying, let me know. If this behavior will be confirmed by you, it is the reason to file a bug in FOP BTS. -- regards, ET 2017-08-09 21:57 GMT+03:00 Gerry : > I'm using the Camel FOP Component version 2.19.1 which brings in the FOP 2.1 > dependency. The application must be self-contained - deployable as a fat > WAR. or JAR and Dockerized, or run within a Tomcat container. I have the > fonts in the "resources" project folder which means Maven will place the > font files at the root of my classpath - directly under the /classes folder > within the WAR. > > My FOP configuration file is loading correctly, and the fonts are found fine > if I just place my fonts in a local directory and hardcode the absolute path > to them like *embed-url="file:///C:/fonts/HelveticaNeueLTStd-Lt.ttf"*. > However when I try a relative URL as in > *embed-url="HelveticaNeueLTStd-Lt.ttf"* an exception is thrown saying "*URI > is not absolute*". This makes little sense, since the FOP documentation > states that a relative URI can be used and that's what the ** is > for! Very confusing... > > I've tried a lot of things without success over the past few days, such as > even replacing "*file:*" in the URI with "*classpath:*", however unlike the > other Apache projects it seems to only support "*file:*". I've even tried > removing my font registration from the config file completely, and just > using **. While it finds all the fonts on my system (in > about 5 minutes!) it does not find the font at the root of my classpath. > Additionally even if it did work, I'd prefer FOP not to scan every installed > system font and attempt to create TEMP cache files because this must be > deployable in Docker containers within a cloud environment. > > Is what I'm trying to do even possible with the current FOP implementation? > > > > > -- > View this message in context: > http://apache-fop.1065347.n5.nabble.com/Configuring-for-Fonts-included-within-a-Spring-Boot-Camel-Microservice-tp45367.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: To PDF/a Conversion without licensed fonts (java)
Hello, I tried your code after putting the ghostScript polices in the right file but it seem that fonts `embed-url` only accept `.pfm` or `.afm` since I got this error: Input: XSL-FO (.\xml\fo\fonts.fo) Output: PDF (.\out\ResultFO2PDF.pdf) Transforming... aoĂťt 10, 2017 5:17:40 PM org.apache.fop.fonts.LazyFont load GRAVE: Failed to read font metrics file null java.io.FileNotFoundException: Neither an AFM nor a PFM file was found for C:/Users/thinkpad/workspace/FopConverter/Fonts/ttf/ghostFonts/notTtfFonts/n019003l.pfb I still don't quite understand how the way FOP font's configuration but no it doesn't matter. I moved onto another java library that use Word to do the conversion since it's easier but thank you for your help. Fop look like an amazing library but maybe it is a too complex tool for a novice like me. -- View this message in context: http://apache-fop.1065347.n5.nabble.com/To-PDF-a-Conversion-without-licensed-fonts-java-tp45365p45368.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Configuring for Fonts included within a Spring-Boot/Camel Microservice
I'm using the Camel FOP Component version 2.19.1 which brings in the FOP 2.1 dependency. The application must be self-contained - deployable as a fat WAR. or JAR and Dockerized, or run within a Tomcat container. I have the fonts in the "resources" project folder which means Maven will place the font files at the root of my classpath - directly under the /classes folder within the WAR. My FOP configuration file is loading correctly, and the fonts are found fine if I just place my fonts in a local directory and hardcode the absolute path to them like *embed-url="file:///C:/fonts/HelveticaNeueLTStd-Lt.ttf"*. However when I try a relative URL as in *embed-url="HelveticaNeueLTStd-Lt.ttf"* an exception is thrown saying "*URI is not absolute*". This makes little sense, since the FOP documentation states that a relative URI can be used and that's what the ** is for! Very confusing... I've tried a lot of things without success over the past few days, such as even replacing "*file:*" in the URI with "*classpath:*", however unlike the other Apache projects it seems to only support "*file:*". I've even tried removing my font registration from the config file completely, and just using **. While it finds all the fonts on my system (in about 5 minutes!) it does not find the font at the root of my classpath. Additionally even if it did work, I'd prefer FOP not to scan every installed system font and attempt to create TEMP cache files because this must be deployable in Docker containers within a cloud environment. Is what I'm trying to do even possible with the current FOP implementation? -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Configuring-for-Fonts-included-within-a-Spring-Boot-Camel-Microservice-tp45367.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: To PDF/a Conversion without licensed fonts (java)
Hello Arthur, what you could try (checking the license) is using the ghostscript fonts like... etc. BR Stefan 07.08.2017 17:26, Arthur R. wrote: > Hello, I'm trying to convert ".fo" to PDF/a with FOP files for quite a long > time and I hoped you could help me. Please excuse my English. > > I don't have the rights to use the base 14 fonts so I do have to substitute > those fonts with free fonts. In order to do so I have to embed those free > fonts through the "fop.conf" file then substitute them to the licensed > fonts. I thought the following codes would do the trick but it failed: > > -Declare the FreeFont (FF) with the Licensed Font (LF) name: > <...font kerning="yes" > embed-url="C:/Users/thinkpad/workspace/FopConverter/Fonts/ttf/arial.ttf" > name="Arial" > > > <.../font> > > -Declare the FF with its own name then substitute the LF by the FF: > <...font kerning="yes" > embed-url="C:/Users/thinkpad/workspace/FopConverter/Fonts/arial.ttf" > name="Arial"> > > <.../font> > > > > > > > > -I also tried to declare the font with or with > , then made the substitution, but it did not worked. > > One of the reason of this fail might be that I miss declared the base14 > fonts. I think that with the present FOP documentation it is really hard to > correctly declare a font which will serve as base 14 font. I would like to > have an exemple of how to declare a LF substitute. Such an exemple would > make Apache FOP use for PDF/a creation much easier. > > > > -- > View this message in context: > http://apache-fop.1065347.n5.nabble.com/To-PDF-a-Conversion-without-licensed-fonts-java-tp45365.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > -- Stefan Hegny, Geschäftsfßhrer/Manager hydrografix Consulting GmbH he...@hydrografix.com Tel. +49 - 173-3257674Fax +49 - 6106-772614 GÜrlitzer Str. 13 D-63110 RodgauAmtsgericht Offenbach/Main HRB 43974 Geschäftsfßhrer: Roland Junker, Stefan Hegny - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
To PDF/a Conversion without licensed fonts (java)
Hello, I'm trying to convert ".fo" to PDF/a with FOP files for quite a long time and I hoped you could help me. Please excuse my English. I don't have the rights to use the base 14 fonts so I do have to substitute those fonts with free fonts. In order to do so I have to embed those free fonts through the "fop.conf" file then substitute them to the licensed fonts. I thought the following codes would do the trick but it failed: -Declare the FreeFont (FF) with the Licensed Font (LF) name: <...font kerning="yes" embed-url="C:/Users/thinkpad/workspace/FopConverter/Fonts/ttf/arial.ttf" name="Arial" > <.../font> -Declare the FF with its own name then substitute the LF by the FF: <...font kerning="yes" embed-url="C:/Users/thinkpad/workspace/FopConverter/Fonts/arial.ttf" name="Arial"> <.../font> -I also tried to declare the font with or with , then made the substitution, but it did not worked. One of the reason of this fail might be that I miss declared the base14 fonts. I think that with the present FOP documentation it is really hard to correctly declare a font which will serve as base 14 font. I would like to have an exemple of how to declare a LF substitute. Such an exemple would make Apache FOP use for PDF/a creation much easier. -- View this message in context: http://apache-fop.1065347.n5.nabble.com/To-PDF-a-Conversion-without-licensed-fonts-java-tp45365.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP 2.2 - loading fonts
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: > kerning="yes" > embed-url="arial.ttf"> > weight="normal"/> > > > 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-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > > -- Stefan Hegny, Geschäftsfßhrer/Manager hydrografix Consulting GmbH he...@hydrografix.com Tel. +49 - 173-3257674Fax +49 - 6106-772614 GÜrlitzer Str. 13 D-63110 RodgauAmtsgericht Offenbach/Main HRB 43974 Geschäftsfßhrer: Roland Junker, Stefan Hegny - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
FOP 2.2 - loading fonts
Hi guys, I got problems with loading fonts. fop.xml config got this definition of a 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-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Spurious warning about missing fonts
On 28.07.2016 16:02, Glenn Adams wrote: > They aren't spurious. You need to find where you are using these > fonts (directly or indirectly). It seems you are using bold versions > of Symbol and ZapfDingbats. I think you misunderstand. I'm not using bold version of these fonts, but check out the description from the Jira entry: > When the font-family property hasn't been specified in the FO file, > it defaults to "sans-serif,Symbol,ZapfDingbats". But the latter two > aren't available in a bold variant. When a block of text can be > rendered using the sans-serif family only, warnings are still issued > about unavailable Symbol bold and ZapfDingbats bold. This is likely > to puzzle users. So basically this happens every time you use default font setting and want to use the bold font. Regards Stefan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Spurious warning about missing fonts
They aren't spurious. You need to find where you are using these fonts (directly or indirectly). It seems you are using bold versions of Symbol and ZapfDingbats. On Thu, Jul 28, 2016 at 7:11 AM, Stefan Radermacher wrote: > Hello, > > FOP is generating a lot of warning about not finding some of the base-14 > fonts, even though I'm not actually using those. When processing my > files, I'm practically inundated with these messages: > > > Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400". > Font "ZapfDingbats,normal,700" not found. Substituting with > "ZapfDingbats,normal,400". > > I did some research and found this old archived discussion from the > fop-dev list: > > > http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-found-whereas-they-are-not-needed-td31330.html > > and also an entry in FOP's jira tracker: > > https://issues.apache.org/jira/browse/FOP-1667 > > Both seem to indicate that this is the issue I am encountering. However > this problem is practially ancient, is there any chance that this might > get fixed? > > Kind regards > Stefan > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > >
Spurious warning about missing fonts
Hello, FOP is generating a lot of warning about not finding some of the base-14 fonts, even though I'm not actually using those. When processing my files, I'm practically inundated with these messages: Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400". Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400". I did some research and found this old archived discussion from the fop-dev list: http://apache-fop.1065347.n5.nabble.com/ZapfDingbats-and-Symbol-not-found-whereas-they-are-not-needed-td31330.html and also an entry in FOP's jira tracker: https://issues.apache.org/jira/browse/FOP-1667 Both seem to indicate that this is the issue I am encountering. However this problem is practially ancient, is there any chance that this might get fixed? Kind regards Stefan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Problem embedding fonts in PDF
On 26.07.2016 17:26, Simon Steiner wrote: > What about: > > FopConfParser parser = new FopConfParser(configFile, currentDir); > FopFactoryBuilder fopFactoryBuilder = parser.getFopFactoryBuilder(); Thank you, that looks much better. I used the FopConfParser constructor that just takes the config File, and then got this error: "The Fontbox jar was not found in the classpath. This is required for OTF CFF ssupport." (sic) I added Fontbox 1.8.9 to my dependencies, and voila the font loads! Kind regards and thank you, Stefan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Problem embedding fonts in PDF
Hi, What about: FopConfParser parser = new FopConfParser(configFile, currentDir); FopFactoryBuilder fopFactoryBuilder = parser.getFopFactoryBuilder(); Thanks -Original Message- From: Stefan Radermacher [mailto:ste...@zaister.de] Sent: 26 July 2016 16:07 To: fop-users@xmlgraphics.apache.org Subject: Problem embedding fonts in PDF Hello, I am looking for some help on embedding fonts with FOP (version 2.1). I am working on program that uses FOP to create PDF files. Unfortunately the standard fonts included in FOP do not have glyphs for many international character that we would like to be able to include in our generated PDFs. So I have started on looking to embed custom fonts. I am trying this with a free font called Gandhi Sans for now. I think I have set up the stuff as the documentation indicates, but my font configuration gets ignored and FOP produces a lot of warnings listing: "Font "Gandhi Sans,normal,400" not found. Substituting with "any,normal,400"" My fop.xconf file looks as follows (relevant parts only): ---- snip ./ fonts/ flate ... snip I do have the weird feeling that the file gets ignored somehow, since even when I modify it to point to a non-existent font file or even to have an invalid xml structure, I'm not getting any errors or exceptions about this. Anyway, the fonts are located in a folder "fonts" that is on the same level as the fop.xconf file. I have tried using full paths or full URIs with file:// prefix to indicate the font files, but no change. I have also tried with and without trailing slash for the base and font-base properties. I'm adding the file in my Java code like this: snip FopFactoryBuilder builder; File userConfigFile = new File(ConfigurationSettings.getOutputSheetsDir() + File.separator + "fop.xconf"); try { builder = new FopFactoryBuilder(userConfigFile.toURI()); } catch (Exception e) { [exception handling] } builder.setStrictFOValidation(false); builder.setStrictUserConfigValidation(true); FopFactory fopFactory = builder.build(); FOUserAgent userAgent = fopFactory.newFOUserAgent(); userAgent.getEventBroadcaster().addEventListener( new FOPEventListener()); [set some userAgent attributes] try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out); TransformerFactory transFactory = TransformerFactory.newInstance(); Transformer transformer = transFactory.newTransformer(xsltSource); transformer.setErrorListener(new FOPErrorListener()); transformer.transform(inputSource, new SAXResult(fop.getDefaultHandler())); } catch (TransformerException | FOPException | IOException e) { [exception handling] } snip What am I doing wrong? Kind regards and thanks for any help, Stefan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Problem embedding fonts in PDF
Hello, I am looking for some help on embedding fonts with FOP (version 2.1). I am working on program that uses FOP to create PDF files. Unfortunately the standard fonts included in FOP do not have glyphs for many international character that we would like to be able to include in our generated PDFs. So I have started on looking to embed custom fonts. I am trying this with a free font called Gandhi Sans for now. I think I have set up the stuff as the documentation indicates, but my font configuration gets ignored and FOP produces a lot of warnings listing: "Font "Gandhi Sans,normal,400" not found. Substituting with "any,normal,400"" My fop.xconf file looks as follows (relevant parts only): ---- snip ./ fonts/ flate ... snip I do have the weird feeling that the file gets ignored somehow, since even when I modify it to point to a non-existent font file or even to have an invalid xml structure, I'm not getting any errors or exceptions about this. Anyway, the fonts are located in a folder "fonts" that is on the same level as the fop.xconf file. I have tried using full paths or full URIs with file:// prefix to indicate the font files, but no change. I have also tried with and without trailing slash for the base and font-base properties. I'm adding the file in my Java code like this: snip FopFactoryBuilder builder; File userConfigFile = new File(ConfigurationSettings.getOutputSheetsDir() + File.separator + "fop.xconf"); try { builder = new FopFactoryBuilder(userConfigFile.toURI()); } catch (Exception e) { [exception handling] } builder.setStrictFOValidation(false); builder.setStrictUserConfigValidation(true); FopFactory fopFactory = builder.build(); FOUserAgent userAgent = fopFactory.newFOUserAgent(); userAgent.getEventBroadcaster().addEventListener( new FOPEventListener()); [set some userAgent attributes] try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, userAgent, out); TransformerFactory transFactory = TransformerFactory.newInstance(); Transformer transformer = transFactory.newTransformer(xsltSource); transformer.setErrorListener(new FOPErrorListener()); transformer.transform(inputSource, new SAXResult(fop.getDefaultHandler())); } catch (TransformerException | FOPException | IOException e) { [exception handling] } snip What am I doing wrong? Kind regards and thanks for any help, Stefan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Fonts in the class path makes fonts listing fail
Hi Chris, There it is: https://issues.apache.org/jira/browse/FOP-2611 I hope I did this the right way. BR, -- *NeoDoc* *Maxime BĂŠgnis* max...@neodoc.fr TĂŠl: +33 (0)4.42.52.24.20 789 Rue de La Gare 13770 Venelles France http://www.neodoc.fr/ Le 20/06/2016 11:16, Chris Bowditch a ĂŠcrit : > Hi Maxime, > > You can file a bug using JIRA, see: > http://xmlgraphics.apache.org/fop/bugs.html > > Thanks, > > Chris > > On 17/06/2016 08:24, Maxime BĂŠgnis wrote: >> Hello, >> >> Is there a way for me to file a bug report about this? >> >> BR, >> >> -- >> *NeoDoc* >> *Maxime BĂŠgnis* >> max...@neodoc.fr >> TĂŠl: +33 (0)4.42.52.24.20 >> 789 Rue de La Gare >> 13770 Venelles >> France >> http://www.neodoc.fr/ >> Le 10/06/2016 10:43, Maxime BĂŠgnis a ĂŠcrit : >>> 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.(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.(RenderPagesModel.java:75) >>> at >>> org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135) >>> >>> at >>> org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:105) >>> at >>> org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:350) >>> at org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:107) >>> at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:104) >>> at org.apache.fop.apps.Fop.(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) >>> >>> 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). >>> >>> I'm using FOP 2.1 (from >>> https://xmlgraphics.apache.org/fop/download.html) under Ubuntu 14.04 >>> LTS Linux. >>> >>> BR, >>> >>> -- >>> -- >>> *NeoDoc* >>> *Maxime BĂŠgnis* >>> max...@neodoc.fr >>> TĂŠl: +33 (0)4.42.52.24.20 >>> 789 Rue de La Gare >>> 13770 Venelles >>> France >>> http://www.neodoc.fr/ >> > > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org >
Re: Fonts in the class path makes fonts listing fail
Hi Maxime, You can file a bug using JIRA, see: http://xmlgraphics.apache.org/fop/bugs.html Thanks, Chris On 17/06/2016 08:24, Maxime BĂŠgnis wrote: Hello, Is there a way for me to file a bug report about this? BR, -- *NeoDoc* *Maxime BĂŠgnis* max...@neodoc.fr TĂŠl: +33 (0)4.42.52.24.20 789 Rue de La Gare 13770 Venelles France http://www.neodoc.fr/ Le 10/06/2016 10:43, Maxime BĂŠgnis a ĂŠcrit : 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.(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.(RenderPagesModel.java:75) at org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135) at org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:105) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:350) at org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:107) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:104) at org.apache.fop.apps.Fop.(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) 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). I'm using FOP 2.1 (from https://xmlgraphics.apache.org/fop/download.html) under Ubuntu 14.04 LTS Linux. BR, -- -- *NeoDoc* *Maxime BĂŠgnis* max...@neodoc.fr TĂŠl: +33 (0)4.42.52.24.20 789 Rue de La Gare 13770 Venelles France http://www.neodoc.fr/ - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Fonts in the class path makes fonts listing fail
Hello, Is there a way for me to file a bug report about this? BR, -- *NeoDoc* *Maxime BĂŠgnis* max...@neodoc.fr TĂŠl: +33 (0)4.42.52.24.20 789 Rue de La Gare 13770 Venelles France http://www.neodoc.fr/ Le 10/06/2016 10:43, Maxime BĂŠgnis a ĂŠcrit : > 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.(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.(RenderPagesModel.java:75) > at > org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135) > at > org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:105) > at > org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:350) > at org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:107) > at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:104) > at org.apache.fop.apps.Fop.(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) > > 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). > > I'm using FOP 2.1 (from > https://xmlgraphics.apache.org/fop/download.html) under Ubuntu 14.04 > LTS Linux. > > BR, > > -- > -- > *NeoDoc* > *Maxime BĂŠgnis* > max...@neodoc.fr > TĂŠl: +33 (0)4.42.52.24.20 > 789 Rue de La Gare > 13770 Venelles > France > http://www.neodoc.fr/
Fonts in the class path makes fonts listing fail
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.(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.(RenderPagesModel.java:75) at org.apache.fop.area.AreaTreeHandler.setupModel(AreaTreeHandler.java:135) at org.apache.fop.area.AreaTreeHandler.(AreaTreeHandler.java:105) at org.apache.fop.render.RendererFactory.createFOEventHandler(RendererFactory.java:350) at org.apache.fop.fo.FOTreeBuilder.(FOTreeBuilder.java:107) at org.apache.fop.apps.Fop.createDefaultHandler(Fop.java:104) at org.apache.fop.apps.Fop.(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) 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). I'm using FOP 2.1 (from https://xmlgraphics.apache.org/fop/download.html) under Ubuntu 14.04 LTS Linux. BR, -- -- *NeoDoc* *Maxime BĂŠgnis* max...@neodoc.fr TĂŠl: +33 (0)4.42.52.24.20 789 Rue de La Gare 13770 Venelles France http://www.neodoc.fr/
Re: WG: Embedding Fonts for PDF/A
Hi, Oh after i wrote the lines below i see YOUR CONFIG IS MISSING: the font definitions need to be in the fonts tag. So ie.: ... ... Before i recognized the missing in config: As i make fo and config to using fonts, it may help you, try it: First: In FOP config define the directive. Second: In FOP renderer config, where you define fonts, in embed-url use only the file name without path (wich is defined in font-base) Define the font name as it is in the ttf, ie.: "DejaVu Sans" not "DejaVuSans" !!! - may try to use the embedding-mode="full" attribute (i know it will make larger PDF file size) Third: Use the font in fo by its given=real name: font-family="DejaVu Sans" I hope this will help you. Bye, Szeak 2016-01-07 10:14 keltezĂŠssel, Tunahan Coban Ărta: Hey, I added Pascals variations to my config file and change in the xsl again : . But it still doesn't work. I get the following sentences: // a lot of these Warnings 16:40:27,941 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) The following feature isn't implemented by Apache FOP, yet: table-layout="auto" (on fo:table) (Keine Kontextinformationen verfĂźgbar) 16:40:29,082 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) table-layout="fixed" and column-width unspecified => falling back to proportional-column-width(1) (No context info available) 16:40:29,268 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) The contents of fo:inline line 1 exceed the available area in the inline-progression direction by 3896 millipoints. (No context info available) 16:40:29,145 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) Font "DejaVuSans,normal,400" not found. Substituting with "any,normal,400". 16:40:29,145 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) Font "DejaVuSans,normal,700" not found. Substituting with "any,normal,700". 16:40:29,675 ERROR [org.apache.fop.fo.FOTreeBuilder] (http-/0.0.0.0:7080-2) org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman 16:40:29,690 ERROR [stderr] (http-/0.0.0.0:7080-2) (Position des Fehlers unbekannt)org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman Here is my finally config file after adding your variations: true PDF/A-1a 1.4 Where could be this problem? Thanks. -- -UrsprĂźngliche Nachricht- Von: Pascal Sancho [mailto:psancho@gmail.com] Gesendet: Mittwoch, 6. Januar 2016 16:20 An: Tunahan Coban; fop-users@xmlgraphics.apache.org Betreff: Re: Embedding Fonts for PDF/A (Tunahan sent me the FO file off-list, due to confidential things) Tunahan, I can reproduce DejaVu substitution: Your config lacks font descriptions for variations: 2016-01-06 15:26 GMT+01:00 Tunahan Coban : Hi Pascal, Thank you to invest your time for me. It is better for me that our conversation don't been uploaded to the mail list site. Because of the internal informations. I hope I understand you correctly with the xsl-fo file. Now I have converted my XML file with the stylesheet to FO. I will send you this as a mail-attachment. When you could say me what kind of mistakes you search, so can I help you.. Because the file is too long, you will see.. :/ Thanks so much ! -- -UrsprĂźngliche Nachricht- Von: Pascal Sancho [mailto:psancho@gmail.com] Gesendet: Mittwoch, 6. Januar 2016 14:43 An: Tunahan Coban Betreff: Re: Embedding Fonts for PDF/A Hi, Please, rather than XSL stylsheet, it's easier for us to play with resulting XSL-FO, witch can be achieved without FOP, using XALAN, for example. And it is better to attach such file rather than copy/paste in mail body: all blank spaces and lines are preserved, with actual used encoding. 2016-01-06 14:06 GMT+01:00 Tunahan Coban : Hi Pascal, I sent the first part (because the file is 3000 lines long) fro
WG: Embedding Fonts for PDF/A
Hey, I added Pascals variations to my config file and change in the xsl again : . But it still doesn't work. I get the following sentences: // a lot of these Warnings 16:40:27,941 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) The following feature isn't implemented by Apache FOP, yet: table-layout="auto" (on fo:table) (Keine Kontextinformationen verfĂźgbar) 16:40:29,082 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) table-layout="fixed" and column-width unspecified => falling back to proportional-column-width(1) (No context info available) 16:40:29,268 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) The contents of fo:inline line 1 exceed the available area in the inline-progression direction by 3896 millipoints. (No context info available) 16:40:29,145 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) Font "DejaVuSans,normal,400" not found. Substituting with "any,normal,400". 16:40:29,145 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-2) Font "DejaVuSans,normal,700" not found. Substituting with "any,normal,700". 16:40:29,675 ERROR [org.apache.fop.fo.FOTreeBuilder] (http-/0.0.0.0:7080-2) org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman 16:40:29,690 ERROR [stderr] (http-/0.0.0.0:7080-2) (Position des Fehlers unbekannt)org.apache.fop.pdf.PDFConformanceException: For PDF/A-1a, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman Here is my finally config file after adding your variations: true PDF/A-1a 1.4 Where could be this problem? Thanks. -- -UrsprĂźngliche Nachricht- Von: Pascal Sancho [mailto:psancho@gmail.com] Gesendet: Mittwoch, 6. Januar 2016 16:20 An: Tunahan Coban; fop-users@xmlgraphics.apache.org Betreff: Re: Embedding Fonts for PDF/A (Tunahan sent me the FO file off-list, due to confidential things) Tunahan, I can reproduce DejaVu substitution: Your config lacks font descriptions for variations: 2016-01-06 15:26 GMT+01:00 Tunahan Coban : > Hi Pascal, > > Thank you to invest your time for me. It is better for me that our > conversation don't been uploaded to the mail list site. Because of the > internal informations. I hope I understand you correctly with the xsl-fo file. > Now I have converted my XML file with the stylesheet to FO. > I will send you this as a mail-attachment. > > When you could say me what kind of mistakes you search, so can I help > you.. Because the file is too long, you will see.. :/ > > Thanks so much ! > > -- > > > -UrsprĂźngliche Nachricht- > Von: Pascal Sancho [mailto:psancho@gmail.com] > Gesendet: Mittwoch, 6. Januar 2016 14:43 > An: Tunahan Coban > Betreff: Re: Embedding Fonts for PDF/A > > Hi, > > Please, rather than XSL stylsheet, it's easier for us to play with resulting > XSL-FO, witch can be achieved without FOP, using XALAN, for example. > And it is better to attach such file rather than copy/paste in mail > body: all blank spaces and lines are preserved, with actual used encoding. > > 2016-01-06 14:06 GMT+01:00 Tunahan Coban : >> Hi Pascal, >> >> >> >> I sent the first part (because the file is 3000 lines long) from the >> *.xsl file, too. >> >> Here again: >> >> >> >> >> >> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >> xmlns:fo="http://www.w3.org/1999/XSL/Format";> >> >> >> >> >> >> > page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" >> margin-right="2cm"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > initial-page-number="1" format="1"> >> >> >> >> >> >> >> >> >> >> >> >>
Re: Embedding Fonts for PDF/A
Hi Pascal, I sent the first part (because the file is 3000 lines long) from the *.xsl file, too. Here again: http://www.w3.org/1999/XSL/Transform"; xmlns:fo="http://www.w3.org/1999/XSL/Format";> . ... I tested now the normal PDF converting and its still does work. Only the PDF/A doesn't work.. Maybe my java-code is wrong? // TODO:Fonts configuration in work DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File("cfg.xml")); FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new File(".").toURI()).setConfiguration(cfg); final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI()); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); OutputStream pdfOut = new BufferedOutputStream(pdfOutputStream); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, pdfOut); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(styleSheet); transformer.setParameter("versionParam", "2.0"); Result fopResult = new SAXResult(fop.getDefaultHandler()); transformer.transform(xml, fopResult); } finally { pdfOut.close(); } } catch (Exception e) { e.printStackTrace(System.err); } } Thanks ! --
Re: Embedding Fonts for PDF/A
(Tunahan sent me the FO file off-list, due to confidential things) Tunahan, I can reproduce DejaVu substitution: Your config lacks font descriptions for variations: 2016-01-06 15:26 GMT+01:00 Tunahan Coban : > Hi Pascal, > > Thank you to invest your time for me. It is better for me that our > conversation don't been uploaded to the mail list site. Because of the > internal informations. I hope I understand you correctly with the xsl-fo file. > Now I have converted my XML file with the stylesheet to FO. > I will send you this as a mail-attachment. > > When you could say me what kind of mistakes you search, so can I help you.. > Because the file is too long, you will see.. :/ > > Thanks so much ! > > -- > > > -UrsprĂźngliche Nachricht- > Von: Pascal Sancho [mailto:psancho@gmail.com] > Gesendet: Mittwoch, 6. Januar 2016 14:43 > An: Tunahan Coban > Betreff: Re: Embedding Fonts for PDF/A > > Hi, > > Please, rather than XSL stylsheet, it's easier for us to play with resulting > XSL-FO, witch can be achieved without FOP, using XALAN, for example. > And it is better to attach such file rather than copy/paste in mail > body: all blank spaces and lines are preserved, with actual used encoding. > > 2016-01-06 14:06 GMT+01:00 Tunahan Coban : >> Hi Pascal, >> >> >> >> I sent the first part (because the file is 3000 lines long) from the >> *.xsl file, too. >> >> Here again: >> >> >> >> >> >> > xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; >> xmlns:fo="http://www.w3.org/1999/XSL/Format";> >> >> >> >> >> >> > page-width="21cm" margin-top="2cm" margin-bottom="2cm" margin-left="2cm" >> margin-right="2cm"> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > initial-page-number="1" format="1"> >> >> >> >> >> >> >> >> >> >> >> >> > space-before.optimum="1pt" space-after.optimum="2pt"> >> >> >> >> >> >> >> >> >> >> >> >> > text-align="center" padding-start="3pt" padding-end="3pt" >> padding-before="3pt" padding-after="3pt" display-align="center" >> border-style="solid" border-width="1pt" border-color="white"> >> >> >> >> > select="data"> >> >> > select="texts"> >> >> > select="DateText"> >> >> > font-size="7pt"> >> >> >> >> >> >> >> >> >> >> >> >> >>âŚ.. >> >> >> >> ⌠>> >> >> >> I tested now the normal PDF converting and its still does work. Only >> the PDF/A doesnât work.. >> >> Maybe my java-code is wrong? >> >> >> >> // TODO:Fonts configuration in work >> >>DefaultConfigurationBuilder cfgBuilder = new >> DefaultConfigurationBuilder(); >> >>Configuration cfg = cfgBuilder.buildFromFile(new >> File("cfg.xml")); >> >>FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new >> File(".").toURI()).setConfiguration(cfg); >> >> >> >> >> >> final FopFactory fopFactory = FopFactory.newInstance(new >> File(".").toURI()); >> >> >> >> >> >> FOUserAgent foUserAgent = fopFactory.newFOU
Re: Fonts in PDF Servlet FOP 2.0
igureFopFactory(FopFactoryBuilder builder) { //Subclass and override this method to perform additional configuration } /** * {@inheritDoc} */ public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException { try { //Get parameters String foParam = request.getParameter(FO_REQUEST_PARAM); String xmlParam = request.getParameter(XML_REQUEST_PARAM); String xsltParam = request.getParameter(XSLT_REQUEST_PARAM); //Analyze parameters and decide with method to use if (foParam != null) { renderFO(foParam, response); } else if ((xmlParam != null) && (xsltParam != null)) { renderXML(xmlParam, xsltParam, response); } else { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println("Error\n" + "FopServlet ErrorNo 'fo' " + "request param given."); } } catch (Exception ex) { throw new ServletException(ex); } } /** * Converts a String parameter to a JAXP Source object. * @param param a String parameter * @return Source the generated Source object */ protected Source convertString2Source(String param) { Source src; try { src = uriResolver.resolve(param, null); } catch (TransformerException e) { src = null; } if (src == null) { src = new StreamSource(new File(param)); } return src; } private void sendPDF(byte[] content, HttpServletResponse response) throws IOException { //Send the result back to the client response.setContentType("application/pdf"); response.setContentLength(content.length); response.getOutputStream().write(content); response.getOutputStream().flush(); } /** * Renders an XSL-FO file into a PDF file. The PDF is written to a byte * array that is returned as the method's result. * @param fo the XSL-FO file * @param response HTTP response object * @throws FOPException If an error occurs during the rendering of the * XSL-FO * @throws TransformerException If an error occurs while parsing the input * file * @throws IOException In case of an I/O problem */ protected void renderFO(String fo, HttpServletResponse response) throws FOPException, TransformerException, IOException { //Setup source Source foSrc = convertString2Source(fo); //Setup the identity transformation Transformer transformer = this.transFactory.newTransformer(); transformer.setURIResolver(this.uriResolver); //Start transformation and rendering process render(foSrc, transformer, response); } /** * Renders an XML file into a PDF file by applying a stylesheet * that converts the XML to XSL-FO. The PDF is written to a byte array * that is returned as the method's result. * @param xml the XML file * @param xslt the XSLT file * @param response HTTP response object * @throws FOPException If an error occurs during the rendering of the * XSL-FO * @throws TransformerException If an error occurs during XSL * transformation * @throws IOException In case of an I/O problem */ protected void renderXML(String xml, String xslt, HttpServletResponse response) throws FOPException, TransformerException, IOException { //Setup sources Source xmlSrc = convertString2Source(xml); Source xsltSrc = convertString2Source(xslt); //Setup the XSL transformation Transformer transformer = this.transFactory.newTransformer(xsltSrc); transformer.setURIResolver(this.uriResolver); //Start transformation and rendering process render(xmlSrc, transformer, response); } /** * Renders an input file (XML or XSL-FO) into a PDF file. It uses the JAXP * transformer given to optionally transform the input document to XSL-FO. * The transformer may be an identity transformer in which case the input * must already be XSL-FO. The PDF is written to a byte array that is * returned as the method's result. * @param src Input XML or XSL-FO * @param transformer Transformer to use for optional transformation * @param response HTTP response object * @throws FOPException If an error occurs during the rendering of the * XSL-FO * @throws TransformerException If an error occurs during XSL * transformation * @throws IOException In case of an I/O problem */ protected void render(Source src, Transformer transformer, HttpServletResponse response) throws FOPException, TransformerException, IOException { FOUserAgent foUserAgent = getFOUserAgent(); //Setup output ByteArrayOutputStream out = new ByteArrayOutputStream(); //Setup FOP Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out); //Make sure the XSL transformation's result is piped through to FOP Result res = new SAXResult(fop.getDefaultHandler()); //Start the transformation and rendering process transformer.transform(src, res); //Return the result sendPDF(out.toByteArray(), response); } /** @return a new FOUserAgent for FOP */ protected FOUserAgent getFOUserAgent() { FOUserAgent userAgent = fopFactory.newFOUserAgent(); //Configure foUserAgent as desired return userAgent; } } > On Dec 19, 2015, a
Re: Embedding Fonts for PDF/A
That should be fo:root not fot:root Sent from my iPhone 6s > On Jan 6, 2016, at 3:41 AM, Tunahan Coban wrote: > > Hi Simon, > > Thanks for your answer. But it doesnât work when I add > font-family=âDejaVuSansâ to fot:root. I deleted the too. > > Maybe my java-code has a problem? > > // TODO:Fonts configuration in work > DefaultConfigurationBuilder cfgBuilder = new > DefaultConfigurationBuilder(); > Configuration cfg = cfgBuilder.buildFromFile(new > File("cfg.xml")); > FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new > File(".").toURI()).setConfiguration(cfg); > > > final FopFactory fopFactory = FopFactory.newInstance(new > File(".").toURI()); > > > FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); > foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); >// fopFactoryBuilder.setConfiguration(this.getClass().getResource(c)) > > > OutputStream pdfOut = new BufferedOutputStream(pdfOutputStream); > > try { > > Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, > pdfOut); > > TransformerFactory factory = TransformerFactory.newInstance(); > Transformer transformer = factory.newTransformer(styleSheet); > transformer.setParameter("versionParam", "2.0"); > > Result fopResult = new SAXResult(fop.getDefaultHandler()); > > transformer.transform(xml, fopResult); > > > } finally { >pdfOut.close(); > } > > } catch (Exception e) { > e.printStackTrace(System.err); > } > } > > Thanks
Re: Embedding Fonts for PDF/A
Hi, Simon asked for XSL-FO file (what feeds FOP), not fop.xconf 2016-01-06 13:18 GMT+01:00 Tunahan Coban : > Edit: > > > > I change the font to Arial. But it still doesnât work. > > > > > >true > > > > > > PDF/A-1a > > 1.4 > > > > embed-url="file:///C:/Utilities/arial.ttf"> > > weight="normal"/> > > > > > > > > > > > > > > > > Thanks. > > > > -- -- pascal - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Embedding Fonts for PDF/A
Edit: I change the font to Arial. But it still doesn't work. true PDF/A-1a 1.4 Thanks. --
RE: Embedding Fonts for PDF/A
Hi Simon, Thanks for your answer. But it doesn't work when I add font-family="DejaVuSans" to fot:root. I deleted the too. Maybe my java-code has a problem? // TODO:Fonts configuration in work DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File("cfg.xml")); FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new File(".").toURI()).setConfiguration(cfg); final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI()); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); // fopFactoryBuilder.setConfiguration(this.getClass().getResource(c)) OutputStream pdfOut = new BufferedOutputStream(pdfOutputStream); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, pdfOut); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(styleSheet); transformer.setParameter("versionParam", "2.0"); Result fopResult = new SAXResult(fop.getDefaultHandler()); transformer.transform(xml, fopResult); } finally { pdfOut.close(); } } catch (Exception e) { e.printStackTrace(System.err); } } Thanks
RE: Embedding Fonts for PDF/A
Hi, Show us the xslfo file. Thanks From: Tunahan Coban [mailto:tunahan.co...@coconet.de] Sent: 06 January 2016 11:42 To: simonsteiner1...@gmail.com; fop-users@xmlgraphics.apache.org Subject: RE: Embedding Fonts for PDF/A Hi Simon, Thanks for your answer. But it doesn't work when I add font-family="DejaVuSans" to fot:root. I deleted the too. Maybe my java-code has a problem? // TODO:Fonts configuration in work DefaultConfigurationBuilder cfgBuilder = new DefaultConfigurationBuilder(); Configuration cfg = cfgBuilder.buildFromFile(new File("cfg.xml")); FopFactoryBuilder fopFactoryBuilder = new FopFactoryBuilder(new File(".").toURI()).setConfiguration(cfg); final FopFactory fopFactory = FopFactory.newInstance(new File(".").toURI()); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); foUserAgent.getRendererOptions().put("pdf-a-mode", "PDF/A-1b"); // fopFactoryBuilder.setConfiguration(this.getClass().getResource(c)) OutputStream pdfOut = new BufferedOutputStream(pdfOutputStream); try { Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, pdfOut); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(styleSheet); transformer.setParameter("versionParam", "2.0"); Result fopResult = new SAXResult(fop.getDefaultHandler()); transformer.transform(xml, fopResult); } finally { pdfOut.close(); } } catch (Exception e) { e.printStackTrace(System.err); } } Thanks
RE: Embedding Fonts for PDF/A
Hi, Add font-family="DejaVuSans" to fo:root, maybe remove auto-detect from conf.xml also. Thanks From: Tunahan Coban [mailto:tunahan.co...@coconet.de] Sent: 06 January 2016 10:11 To: fop-users@xmlgraphics.apache.org Subject: Embedding Fonts for PDF/A Hi, this is my first question to the list and I don't know if this way the right one. So I have a problem with the fonts to generate a PDF/A. I have testing to embed the fonts Helvetica and DejaVuSans but anyone don't work. I used the following conf.xml with trying to embed DejaVuSans: true PDF/A-1a 1.4 I have download the DejaVuSans.ttf from <http://dejavu-fonts.org/wiki/Main_Page> http://dejavu-fonts.org/wiki/Main_Page. Then I get this: 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "DejaVuSans,normal,400" not found. Substituting with "any,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "DejaVuSans,normal,700" not found. Substituting with "any,normal,700". 10:44:20,602 ERROR [org.apache.fop.fo.FOTreeBuilder] (http-/0.0.0.0:7080-4) org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman 10:44:20,602 ERROR [stderr] (http-/0.0.0.0:7080-4) (Position des Fehlers unbekannt)org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman Is it the right way to embed any fonts? It would be greate if you can show me an example with embedding DejaVuSans or Helvetica.. Thank you so much! --
Embedding Fonts for PDF/A
Hi, this is my first question to the list and I don't know if this way the right one. So I have a problem with the fonts to generate a PDF/A. I have testing to embed the fonts Helvetica and DejaVuSans but anyone don't work. I used the following conf.xml with trying to embed DejaVuSans: true PDF/A-1a 1.4 I have download the DejaVuSans.ttf from http://dejavu-fonts.org/wiki/Main_Page. Then I get this: 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "Symbol,normal,700" not found. Substituting with "Symbol,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "ZapfDingbats,normal,700" not found. Substituting with "ZapfDingbats,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "DejaVuSans,normal,400" not found. Substituting with "any,normal,400". 10:44:20,353 WARN [org.apache.fop.apps.FOUserAgent] (http-/0.0.0.0:7080-4) Font "DejaVuSans,normal,700" not found. Substituting with "any,normal,700". 10:44:20,602 ERROR [org.apache.fop.fo.FOTreeBuilder] (http-/0.0.0.0:7080-4) org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman 10:44:20,602 ERROR [stderr] (http-/0.0.0.0:7080-4) (Position des Fehlers unbekannt)org.apache.fop.pdf.PDFConformanceException: For PDF/A-1b, all fonts, even the base 14 fonts, have to be embedded! Offending font: /Times-Roman Is it the right way to embed any fonts? It would be greate if you can show me an example with embedding DejaVuSans or Helvetica.. Thank you so much! --
Fonts in PDF Servlet FOP 2.0
After upgrading from FOP 1.1 to FOP 2.0 my custom fonts are no longer being recognized. I am using the FOPServlet.java code to ant build my fop.war file. In order to get my fonts to work in version 1.1 I had to make the following change: /** * This method is called right after the FopFactory is instantiated and can be overridden * by subclasses to perform additional configuration. */ protected void configureFopFactory() { try { fopFactory.setUserConfig(new File("/conf/fop.xconf")); } catch (SAXException e) { System.out.println(e); } catch (IOException e) { System.out.println(e); } } Iâve read in the release notes for 2.0 that setUserConfig is retired and I have tried to understand how to implement the new method. Can I get some guidance here? When I put the suggested code in, I am getting java compile errors on the FopFactoryBuilder symbol not recognized. Is there a working modified FOPServlet.java that has the points to an external config somewhere? https://xmlgraphics.apache.org/fop/2.0/upgrading.html Here is the code from the above upgrade page I am struggling with: File xconf = new File("fop.xconf"); FopConfParser parser = new FopConfParser(xconf); //parsing configuration FopFactoryBuilder builder = parser.getFopFactoryBuilder(); //building the factory with the user options FOPFactory fopFactory = builder.build(); Fop fop = fopFactory.newFop(MimeConstants.MIME_PDF, foUserAgent, out) Is there a way to set the ant build script to read my config file when building the war file (without having to modify the standard java code)? Here is my fop.xconf in \conf: Thanks! Paul
RE: Getting bold fonts with FOP 2.0 and OpenType CFF fonts
On 2015-07-07 Paul Grosso wrote: > On 2015-07-07 13:04, Jan Tosovsky wrote: > > On 2015-07-06 Paul Grosso wrote: > > >Font "Stempel Garamond LT Std,normal,700" not found. > > >Substituting with "Stempel Garamond LT Std,normal,400". > > >Font "Gill Sans Std,normal,700" not found. > > >Substituting with "Gill Sans Std,normal,400". > > > > In auto-detection font names are taken directly from font info which > > may return different names for different styles, so you cannot use > > simply your font name with bold font-weight, but a dedicated font name > > instead. > > > > You can try opening the font cache (on Windows > > %UserProfile%\.fop\fop-fonts.cache ) in any text editor and try to > > search for your font name. It is surrounded with binary data, but you > > can guess the name which FOP expect. > > > > For Frutiger in my case I have to specify 4 different styles: > > FrutigerLT-Light > > FrutigerLT-LightItalic > > FrutigerLT-Bold > > FrutigerLT-BoldItalic > > > > e.g. this way... > > > font-family="FrutigerLT-Light,FrutigerLT-LightItalic,FrutigerLT-Bold, > > FrutigerLT-BoldItalic"> > > > > I found the names in the cache as you said, so now my FO looks like: > > font-family="GillSansStd,GillSansStd-Italic,GillSansStd- > BoldItalic,GillSansStd-Bold" > font-size="10.5pt" font-weight="bold">General > > but I'm still getting: > > [fop] 7569 WARN [ main ] org.apache.fop.apps.FOUserAgent - > Font "GillSansStd,normal,700" not found. > Substituting with "GillSansStd,normal,400". Sorry for misleading info, the above method doesn't work for me either. It was based on some recent experiments which seemed to be working, but it was rather a coincidence. Jan - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Getting bold fonts with FOP 2.0 and OpenType CFF fonts
On 2015-07-07 13:04, Jan Tosovsky wrote: On 2015-07-06 Paul Grosso wrote: Font "Stempel Garamond LT Std,normal,700" not found. Substituting with "Stempel Garamond LT Std,normal,400". Font "Gill Sans Std,normal,700" not found. Substituting with "Gill Sans Std,normal,400". In auto-detection font names are taken directly from font info which may return different names for different styles, so you cannot use simply your font name with bold font-weight, but a dedicated font name instead. You can try opening the font cache (on Windows %UserProfile%\.fop\fop-fonts.cache ) in any text editor and try to search for your font name. It is surrounded with binary data, but you can guess the name which FOP expect. For Frutiger in my case I have to specify 4 different styles: FrutigerLT-Light FrutigerLT-LightItalic FrutigerLT-Bold FrutigerLT-BoldItalic e.g. this way... I certainly appreciate the suggestion. I found the names in the cache as you said, so now my FO looks like: General but I'm still getting: [fop] 7569 WARN [ main ] org.apache.fop.apps.FOUserAgent - Font "GillSansStd,normal,700" not found. Substituting with "GillSansStd,normal,400". What is supposed to translate "normal,700" into "bold"? When I create a simple document in Word setting the font to Gill Sans Std and insert bold, italic, and bold-italic and convert the file into PDF and look at the Document Properties, Fonts, I see: GillSansStd-Bold (Embedded Subset) and such for the other three flavors, so I believe I have the right font names and that they are properly installed. (I also get bold as desired using a different XML editor and FO processor.) If FOP's auto-detection is the problem, is there a way to work around it? I just don't know enough about FOP's internals to know what could be going wrong and how to fix it. thanks, paul - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Getting bold fonts with FOP 2.0 and OpenType CFF fonts
On 2015-07-06 Paul Grosso wrote: > > Font "Stempel Garamond LT Std,normal,700" not found. > Substituting with "Stempel Garamond LT Std,normal,400". > Font "Gill Sans Std,normal,700" not found. > Substituting with "Gill Sans Std,normal,400". In auto-detection font names are taken directly from font info which may return different names for different styles, so you cannot use simply your font name with bold font-weight, but a dedicated font name instead. You can try opening the font cache (on Windows %UserProfile%\.fop\fop-fonts.cache ) in any text editor and try to search for your font name. It is surrounded with binary data, but you can guess the name which FOP expect. For Frutiger in my case I have to specify 4 different styles: FrutigerLT-Light FrutigerLT-LightItalic FrutigerLT-Bold FrutigerLT-BoldItalic e.g. this way... HTH, Jan <> - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Getting bold fonts with FOP 2.0 and OpenType CFF fonts
I believe the fop.xconf file I am using is the distributed one. All I am using for application/pdf is auto-detect. You can access a copy of my xconf and fo file at http://paulgrosso.name/outgoing/fop/fop.xconf http://paulgrosso.name/outgoing/fop/topic.fo thanks, paul On 2015-07-07 02:55, A Gian wrote: Can you provide a copy of your xconf and fo file ? Thanks , Thanasis > Date: Mon, 6 Jul 2015 13:44:25 -0500 > From: pgrosso-consult...@austin.rr.com > To: fop-users@xmlgraphics.apache.org > Subject: Getting bold fonts with FOP 2.0 and OpenType CFF fonts > > I'm producing PDF using FOP, and I need to use some > OpenType CFF fonts, so I understand I need to use 2.0. > > [I am using FOP with the DITA-OT embedded in Oxygen > on a Windows 7 machine. I was using FOP 1.1, and the > OpenType CFF fonts were (unsurpisingly) not getting > used.] > > I've downloaded and installed 2.0 and was successful > in producing the desired PDF and getting results using > the "normal" versions of my OpenType CFF fonts. However, > I was not getting bold (or italics). Rather, I am getting > messages such as: > > Font "Stempel Garamond LT Std,normal,700" not found. > Substituting with "Stempel Garamond LT Std,normal,400". > Font "Gill Sans Std,normal,700" not found. > Substituting with "Gill Sans Std,normal,400". > > I have the various fonts installed on my machine, and I > am just using auto-detect in fop.xconf. > > In my Fonts directory, there is a "Gill Sans Std" folder > containing the various GillSansStd*.otf files. In other > document processing applications, I can see all the various > flavors of Gill Sans Std, so I'm pretty sure they are > properly installed. I am getting Gill Sans Std normal in > my output, but (per the error message) not bold. > > What do I need to do the have FOP 2.0 use the bold and > italic versions of these fonts? > > paul >
RE: Getting bold fonts with FOP 2.0 and OpenType CFF fonts
Can you provide a copy of your xconf and fo file ? Thanks ,Thanasis > Date: Mon, 6 Jul 2015 13:44:25 -0500 > From: pgrosso-consult...@austin.rr.com > To: fop-users@xmlgraphics.apache.org > Subject: Getting bold fonts with FOP 2.0 and OpenType CFF fonts > > I'm producing PDF using FOP, and I need to use some > OpenType CFF fonts, so I understand I need to use 2.0. > > [I am using FOP with the DITA-OT embedded in Oxygen > on a Windows 7 machine. I was using FOP 1.1, and the > OpenType CFF fonts were (unsurpisingly) not getting > used.] > > I've downloaded and installed 2.0 and was successful > in producing the desired PDF and getting results using > the "normal" versions of my OpenType CFF fonts. However, > I was not getting bold (or italics). Rather, I am getting > messages such as: > > Font "Stempel Garamond LT Std,normal,700" not found. > Substituting with "Stempel Garamond LT Std,normal,400". > Font "Gill Sans Std,normal,700" not found. > Substituting with "Gill Sans Std,normal,400". > > I have the various fonts installed on my machine, and I > am just using auto-detect in fop.xconf. > > In my Fonts directory, there is a "Gill Sans Std" folder > containing the various GillSansStd*.otf files. In other > document processing applications, I can see all the various > flavors of Gill Sans Std, so I'm pretty sure they are > properly installed. I am getting Gill Sans Std normal in > my output, but (per the error message) not bold. > > What do I need to do the have FOP 2.0 use the bold and > italic versions of these fonts? > > paul > > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org >
Getting bold fonts with FOP 2.0 and OpenType CFF fonts
I'm producing PDF using FOP, and I need to use some OpenType CFF fonts, so I understand I need to use 2.0. [I am using FOP with the DITA-OT embedded in Oxygen on a Windows 7 machine. I was using FOP 1.1, and the OpenType CFF fonts were (unsurpisingly) not getting used.] I've downloaded and installed 2.0 and was successful in producing the desired PDF and getting results using the "normal" versions of my OpenType CFF fonts. However, I was not getting bold (or italics). Rather, I am getting messages such as: Font "Stempel Garamond LT Std,normal,700" not found. Substituting with "Stempel Garamond LT Std,normal,400". Font "Gill Sans Std,normal,700" not found. Substituting with "Gill Sans Std,normal,400". I have the various fonts installed on my machine, and I am just using auto-detect in fop.xconf. In my Fonts directory, there is a "Gill Sans Std" folder containing the various GillSansStd*.otf files. In other document processing applications, I can see all the various flavors of Gill Sans Std, so I'm pretty sure they are properly installed. I am getting Gill Sans Std normal in my output, but (per the error message) not bold. What do I need to do the have FOP 2.0 use the bold and italic versions of these fonts? paul - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: FOP 2.0 loading fonts from jar
It is working. Thanks for your help. Pavel On Thu, Jul 2, 2015 at 12:54 PM, Simon Steiner wrote: > Hi, > > > > You can you resource resolver: > > > > static class MyResourceResolver implements ResourceResolver { > > public Resource getResource(URI uri) throws IOException { > > return new Resource(xxx); > > } > > public OutputStream getOutputStream(URI uri) throws IOException { > > throw new RuntimeException(uri.toString()); > > } > > } > > > > public static void main(String[] args) throws TransformerException, > SAXException, IOException { > > String fopxconf = ""; > > > > ResourceResolver cloudResourceResolver = new MyResourceResolver(); > > FopFactoryBuilder confBuilder = new FopConfParser(new > ByteArrayInputStream(fopxconf.getBytes()), > > EnvironmentalProfileFactory.createRestrictedIO(new > File(".").toURI(), cloudResourceResolver)).getFopFactoryBuilder(); > > FopFactory fopFactory = confBuilder.build(); > > FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); > > FileOutputStream fos = new FileOutputStream("out.png"); > > Fop fop = fopFactory.newFop("image/png", foUserAgent, fos); > > TransformerFactory factory = TransformerFactory.newInstance(); > > Transformer transformer = factory.newTransformer(); > > Source src = new StreamSource(new > ByteArrayInputStream(fo.getBytes())); > > Result res = new SAXResult(fop.getDefaultHandler()); > > transformer.transform(src, res); > > fos.close(); > > } > > > > Thanks > > > > *From:* Pavel Cibulka [mailto:pavelcibu...@gmail.com] > *Sent:* 02 July 2015 11:23 > *To:* fop-users@xmlgraphics.apache.org > *Subject:* FOP 2.0 loading fonts from jar > > > > How can I load fonts from .jar in FOP 2.0? > > > > In 1.1 it was possible though URI resolver: > > > > public final class FopClasspathUriResolver extends FOURIResolver > implements URIResolver { > > @Override > > public Source resolve(String href, String base) throws > TransformerException { > > InputStream inputStream = > FopClasspathUriResolver.class.getClassLoader().getResourceAsStream(href); > > if (inputStream != null) { > > return new StreamSource(inputStream); > > } > > return super.resolve(href, base); > > } > > } > > > > FopFactory fopFactory = FopFactory.newInstance(); > > FOURIResolver uriResolver = (FOURIResolver) fopFactory.getURIResolver(); > > uriResolver.setCustomURIResolver(new FopClasspathUriResolver()); > > > > > > In https://xmlgraphics.apache.org/fop/2.0/servlets.html#uriresolver > > Accessing resources in your web application > > this.fopFactory.setURIResolver(this.uriResolver); > > - Function setURIResolver is not in 2.0. > > - Also in 1.1 this was possible without Servlets API. > > > > > > I would be grateful for any help. Working with 2.0 has been really > frustrating experience so far for me. :( >
RE: FOP 2.0 loading fonts from jar
Hi, You can you resource resolver: static class MyResourceResolver implements ResourceResolver { public Resource getResource(URI uri) throws IOException { return new Resource(xxx); } public OutputStream getOutputStream(URI uri) throws IOException { throw new RuntimeException(uri.toString()); } } public static void main(String[] args) throws TransformerException, SAXException, IOException { String fopxconf = ""; ResourceResolver cloudResourceResolver = new MyResourceResolver(); FopFactoryBuilder confBuilder = new FopConfParser(new ByteArrayInputStream(fopxconf.getBytes()), EnvironmentalProfileFactory.createRestrictedIO(new File(".").toURI(), cloudResourceResolver)).getFopFactoryBuilder(); FopFactory fopFactory = confBuilder.build(); FOUserAgent foUserAgent = fopFactory.newFOUserAgent(); FileOutputStream fos = new FileOutputStream("out.png"); Fop fop = fopFactory.newFop("image/png", foUserAgent, fos); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); Source src = new StreamSource(new ByteArrayInputStream(fo.getBytes())); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); fos.close(); } Thanks From: Pavel Cibulka [mailto:pavelcibu...@gmail.com] Sent: 02 July 2015 11:23 To: fop-users@xmlgraphics.apache.org Subject: FOP 2.0 loading fonts from jar How can I load fonts from .jar in FOP 2.0? In 1.1 it was possible though URI resolver: public final class FopClasspathUriResolver extends FOURIResolver implements URIResolver { @Override public Source resolve(String href, String base) throws TransformerException { InputStream inputStream = FopClasspathUriResolver.class.getClassLoader().getResourceAsStream(href); if (inputStream != null) { return new StreamSource(inputStream); } return super.resolve(href, base); } } FopFactory fopFactory = FopFactory.newInstance(); FOURIResolver uriResolver = (FOURIResolver) fopFactory.getURIResolver(); uriResolver.setCustomURIResolver(new FopClasspathUriResolver()); In https://xmlgraphics.apache.org/fop/2.0/servlets.html#uriresolver Accessing resources in your web application this.fopFactory.setURIResolver(this.uriResolver); - Function setURIResolver is not in 2.0. - Also in 1.1 this was possible without Servlets API. I would be grateful for any help. Working with 2.0 has been really frustrating experience so far for me. :(
FOP 2.0 loading fonts from jar
How can I load fonts from .jar in FOP 2.0? In 1.1 it was possible though URI resolver: public final class FopClasspathUriResolver extends FOURIResolver implements URIResolver { @Override public Source resolve(String href, String base) throws TransformerException { InputStream inputStream = FopClasspathUriResolver.class.getClassLoader().getResourceAsStream(href); if (inputStream != null) { return new StreamSource(inputStream); } return super.resolve(href, base); } } FopFactory fopFactory = FopFactory.newInstance(); FOURIResolver uriResolver = (FOURIResolver) fopFactory.getURIResolver(); uriResolver.setCustomURIResolver(new FopClasspathUriResolver()); In https://xmlgraphics.apache.org/fop/2.0/servlets.html#uriresolver Accessing resources in your web application this.fopFactory.setURIResolver(this.uriResolver); - Function setURIResolver is not in 2.0. - Also in 1.1 this was possible without Servlets API. I would be grateful for any help. Working with 2.0 has been really frustrating experience so far for me. :(
SVG Renderer and Fonts
Hi list, a short question: Is there any way to select fonts when using the SVG Renderer? Thanks for your advice, William David VelĂĄsquez RamĂrez. Director de InvestigaciĂłn y Desarrollo MedellĂn: (574) 4447292 BogotĂĄ:  (571) 3058949 MĂłvil: (57) 311 709 8421 wvelasq...@visiontecnologica.com Skype: williamvelasquez   AVISO LEGAL: La informaciĂłn contenida en este e-mail es CONFIDENCIAL y sĂłlo puede ser utilizada por la persona o la compaĂąĂa a la cual estĂĄ dirigido. Si usted no es el destinatario, el uso indebido de esta informaciĂłn estĂĄ prohibido y es sancionado por la ley. Si por error recibe este mensaje, le agradecemos borrarlo e informarle al emisor. Publicidad No S*P*A*M* No es nuestra intenciĂłn generar correo NO DESEADO. Si desea ser retirado de nuestra lista de distribuciĂłn, responda este mensaje a su emisor o al correo conta...@visiontecnologica.com con el asunto Borrar. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
On Tue, Sep 23, 2014 at 4:01 AM, MartinKl wrote: > Hello, > thank you for reaction. > > I just wanted to explained why is not so easy to make automatic test. I´ve > decided to upgrade to fop 1.1 but I strugle the same problem. > > > http://apache-fop.1065347.n5.nabble.com/Upgrading-fop-0-95-to-fop-1-1-because-of-PDF-A-1b-td41090.html#a41160 > < > http://apache-fop.1065347.n5.nabble.com/Upgrading-fop-0-95-to-fop-1-1-because-of-PDF-A-1b-td41090.html#a41160 > > > > There is also an example. > > It is solved now but I had to apply two patches on stable 1.1 version to > make it work. Now we embed full fonts to the pdfs but the size of them > increased dramatically so I would prefer to solve it. > A lot of work has occurred in trunk since 1.1 to reduce font embed sizes. You really should try the current trunk build. > > Great Regards > Martin > > > > -- > View this message in context: > http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41241.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > >
Re: Loading fonts problem
Hello, thank you for reaction. I just wanted to explained why is not so easy to make automatic test. I´ve decided to upgrade to fop 1.1 but I strugle the same problem. http://apache-fop.1065347.n5.nabble.com/Upgrading-fop-0-95-to-fop-1-1-because-of-PDF-A-1b-td41090.html#a41160 <http://apache-fop.1065347.n5.nabble.com/Upgrading-fop-0-95-to-fop-1-1-because-of-PDF-A-1b-td41090.html#a41160> There is also an example. It is solved now but I had to apply two patches on stable 1.1 version to make it work. Now we embed full fonts to the pdfs but the size of them increased dramatically so I would prefer to solve it. Great Regards Martin -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41241.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
As I believe has been mentioned before, any part of the process of translating from arbitrary XML into XSL-FO proper is effectively out of scope for this ML and group unless it is a real bug in the convenience mechanism provided by FOP to invoke XSLT for you. If there is a problem parsing or formatting XSL-FO input, then you need to focus on creating the smallest possible example of XSL-FO document that demonstrates the problem. Everything else that happens up to providing XSL-FO input should be viewed as secondary as far as FOP is concerned. Cheers, Glenn On Mon, Sep 22, 2014 at 12:18 PM, MartinKl wrote: > Hello, > I havent meantion one important thing about how we produce document. We do > it in two ways. The first we use xsl-fo and xml with data. The second one > is > that we have a "special" markup language which produce xls transformation. > The markup language is even simplier than hmtl and serves good for simple > documents mostly with static content. Lots of people in the bank can use it > but they also make mistakes in it. > > > And that the problem causing retesting a big group of real templates. With > automatic test I can cover most of the mistakes but not those user made > ones. > > Another problem is the upgrade doesnt bring much new for us from bussines > side so it is hard to get a budget because bussines managers do not see any > added value. > > I hope I explained it well :) Who work for bank probably smile now because > he knows what I am talking about :) > > > > > > -- > View this message in context: > http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41239.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > >
Re: Loading fonts problem
Hello, I havent meantion one important thing about how we produce document. We do it in two ways. The first we use xsl-fo and xml with data. The second one is that we have a "special" markup language which produce xls transformation. The markup language is even simplier than hmtl and serves good for simple documents mostly with static content. Lots of people in the bank can use it but they also make mistakes in it. And that the problem causing retesting a big group of real templates. With automatic test I can cover most of the mistakes but not those user made ones. Another problem is the upgrade doesnt bring much new for us from bussines side so it is hard to get a budget because bussines managers do not see any added value. I hope I explained it well :) Who work for bank probably smile now because he knows what I am talking about :) -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41239.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Furthermore, the cost of not having automated tests for your PDF generation eclipses any other cost mentioned so far. If I were a banker and my IT guy told me he can't upgrade a library, because he does not have automated tests... hmm :) Ulrich Rob Sargent wrote: Furthermore, the cost of remaining behind the curve is not to be ignored! On 08/04/2014 10:23 AM, Rob Sargent wrote: I've had the pleasure of upgrading from .9x to 1.0 (and beyond) and the only problem I had with the requirement that each cell in a table had an empty block (when of course there is not content). One solid pass through the stylesheets cleaned that up. rjs On 08/04/2014 10:18 AM, Chris Bowditch wrote: Hi Martin, The preflight warning occurs because the font is only subset, instead of fully embedded. In later FOP versions you can specify embedding-mode="full" attribute on the font configuration, but that's not available in FOP v0.95. Thanks, Chris On 04/08/2014 16:55, MartinKl wrote: Thank you for your response. I am trying to generate PDF/A-1b document using FOP 0.95. I know that the version is very old but it is very hard to upgrade because noone wants to pay for it such amount of money for retesting all templates (Bank). I am struggeling with embedding fonts into pdf file. I get error below from adobe acrobat <http://apache-fop.1065347.n5.nabble.com/file/n41013/preflight_verification.gif> my fop.xconf is here https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf <https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf> I´ve also created report from adobe acrobat which can be usefull. https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf <https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf> and doc.pdf is here https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf <https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf> Thank you for response. I hope I´ve provided enough info. Great Regards Martin Klapec -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41013.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Hi Martin, There is no way to fully embed the font in FOP 0.95. If upgrading is not possible, It may be you can avoid the preflight error another way, e.g. by using a different Font. The error says that a CID subset is incomplete. Since you have to use a subset in 0.95, you could try to use a non-CID font instead. Thanks, Chris On 06/08/2014 15:39, MartinKl wrote: Hello Chris, Thank you for your response. Do I have any option to "tell" fop 0.95 that I want to embbed all fonts trought fop.xconf or programatically? Great Regards Martin -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41034.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Hello Chris, Thank you for your response. Do I have any option to "tell" fop 0.95 that I want to embbed all fonts trought fop.xconf or programatically? Great Regards Martin -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41034.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Sorry for not including previous conversation. So how can I embbed all fonts to pdf file? I got it from these resources that it is possible. quote /Note that FOP does not currently support "tagged PDF" or PDF/A-1a. Support for PDF/A-1b and PDF/X has recently been added, however./ http://xmlgraphics.apache.org/fop/0.95/output.html#pdf <http://xmlgraphics.apache.org/fop/0.95/output.html#pdf> and quote /Make sure all (!) fonts are embedded. If you use base 14 fonts (like Helvetica) you need to obtain a license for them and embed them like any other font./ http://xmlgraphics.apache.org/fop/0.95/pdfa.html <http://xmlgraphics.apache.org/fop/0.95/pdfa.html> Thank you all for help. Great Regards Martin rsargent wrote > Furthermore, the cost of remaining behind the curve is not to be ignored! > On 08/04/2014 10:23 AM, Rob Sargent wrote: >> I've had the pleasure of upgrading from .9x to 1.0 (and beyond) and >> the only problem I had with the requirement that each cell in a table >> had an empty block (when of course there is not content). One solid >> pass through the stylesheets cleaned that up. >> >> rjs >> >> On 08/04/2014 10:18 AM, Chris Bowditch wrote: >>> Hi Martin, >>> >>> The preflight warning occurs because the font is only subset, instead >>> of fully embedded. In later FOP versions you can specify >>> embedding-mode="full" attribute on the font configuration, but that's >>> not available in FOP v0.95. >>> >>> Thanks, >>> >>> Chris >>> >>> On 04/08/2014 16:55, MartinKl wrote: >>>> Thank you for your response. >>>> >>>> I am trying to generate PDF/A-1b document using FOP 0.95. I know >>>> that the >>>> version is very old but it is very hard to upgrade because noone >>>> wants to >>>> pay for it such amount of money for retesting all templates (Bank). >>>> >>>> I am struggeling with embedding fonts into pdf file. I get error >>>> below from >>>> adobe acrobat >>>> >>>> <http://apache-fop.1065347.n5.nabble.com/file/n41013/preflight_verification.gif>; >>>> >>>> >>>> >>>> >>>> my fop.xconf is here >>>> https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf >>>> <https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf>; >>>> >>>> I´ve also created report from adobe acrobat which can be usefull. >>>> >>>> https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf >>>> <https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf>; >>>> >>>> and doc.pdf is here >>>> https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf >>>> <https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf>; >>>> >>>> >>>> Thank you for response. I hope I´ve provided enough info. >>>> >>>> Great Regards >>>> Martin Klapec >>>> >>>> >>>> >>>> -- >>>> View this message in context: >>>> http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41013.html >>>> Sent from the FOP - Users mailing list archive at Nabble.com. >>>> >>>> - >>>> To unsubscribe, e-mail: > fop-users-unsubscribe@.apache >>>> For additional commands, e-mail: > fop-users-help@.apache >>>> >>>> >>>> >>> >>> >>> - >>> To unsubscribe, e-mail: > fop-users-unsubscribe@.apache >>> For additional commands, e-mail: > fop-users-help@.apache >>> >> -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41022.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Of course we would like to upgrade but it is not possible right now because of lack of resources (testers, money,..) and amount of templates which would must be tested. But we are trying to force it. Thank you for your response Great Regards Martin Klapec btw. This explain everything about working in a bank ;) http://2.bp.blogspot.com/_b6li6e63YxY/SwNVKzxJ0RI/AqU/hHtp4K0K09s/s1600/Dilbert.gif <http://2.bp.blogspot.com/_b6li6e63YxY/SwNVKzxJ0RI/AqU/hHtp4K0K09s/s1600/Dilbert.gif> -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41021.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Ahh that is why it did not work. I thought when FOP 0.95 supports PDF/A-1b it does it with all required things like embedding full fonts. Probably it is old version of fop and ISO rules has changed ??? Is this violation of PDF/A-1b blocker? I mean when it can be problem? Thank you for your response. Great Regards Martin -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41020.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Furthermore, the cost of remaining behind the curve is not to be ignored! On 08/04/2014 10:23 AM, Rob Sargent wrote: I've had the pleasure of upgrading from .9x to 1.0 (and beyond) and the only problem I had with the requirement that each cell in a table had an empty block (when of course there is not content). One solid pass through the stylesheets cleaned that up. rjs On 08/04/2014 10:18 AM, Chris Bowditch wrote: Hi Martin, The preflight warning occurs because the font is only subset, instead of fully embedded. In later FOP versions you can specify embedding-mode="full" attribute on the font configuration, but that's not available in FOP v0.95. Thanks, Chris On 04/08/2014 16:55, MartinKl wrote: Thank you for your response. I am trying to generate PDF/A-1b document using FOP 0.95. I know that the version is very old but it is very hard to upgrade because noone wants to pay for it such amount of money for retesting all templates (Bank). I am struggeling with embedding fonts into pdf file. I get error below from adobe acrobat <http://apache-fop.1065347.n5.nabble.com/file/n41013/preflight_verification.gif> my fop.xconf is here https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf <https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf> I´ve also created report from adobe acrobat which can be usefull. https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf <https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf> and doc.pdf is here https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf <https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf> Thank you for response. I hope I´ve provided enough info. Great Regards Martin Klapec -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41013.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
I've had the pleasure of upgrading from .9x to 1.0 (and beyond) and the only problem I had with the requirement that each cell in a table had an empty block (when of course there is not content). One solid pass through the stylesheets cleaned that up. rjs On 08/04/2014 10:18 AM, Chris Bowditch wrote: Hi Martin, The preflight warning occurs because the font is only subset, instead of fully embedded. In later FOP versions you can specify embedding-mode="full" attribute on the font configuration, but that's not available in FOP v0.95. Thanks, Chris On 04/08/2014 16:55, MartinKl wrote: Thank you for your response. I am trying to generate PDF/A-1b document using FOP 0.95. I know that the version is very old but it is very hard to upgrade because noone wants to pay for it such amount of money for retesting all templates (Bank). I am struggeling with embedding fonts into pdf file. I get error below from adobe acrobat <http://apache-fop.1065347.n5.nabble.com/file/n41013/preflight_verification.gif> my fop.xconf is here https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf <https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf> I´ve also created report from adobe acrobat which can be usefull. https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf <https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf> and doc.pdf is here https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf <https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf> Thank you for response. I hope I´ve provided enough info. Great Regards Martin Klapec -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41013.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Hi Martin, The preflight warning occurs because the font is only subset, instead of fully embedded. In later FOP versions you can specify embedding-mode="full" attribute on the font configuration, but that's not available in FOP v0.95. Thanks, Chris On 04/08/2014 16:55, MartinKl wrote: Thank you for your response. I am trying to generate PDF/A-1b document using FOP 0.95. I know that the version is very old but it is very hard to upgrade because noone wants to pay for it such amount of money for retesting all templates (Bank). I am struggeling with embedding fonts into pdf file. I get error below from adobe acrobat <http://apache-fop.1065347.n5.nabble.com/file/n41013/preflight_verification.gif> my fop.xconf is here https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf <https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf> I´ve also created report from adobe acrobat which can be usefull. https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf <https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf> and doc.pdf is here https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf <https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf> Thank you for response. I hope I´ve provided enough info. Great Regards Martin Klapec -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41013.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Hello, thank you for your response. About deactivation font cache. The cache is for fonts which could not be loaded so next time the apache fop wont try to load the due performance issues. When I delete the cache font file and run document generation the cache file is there again with my provided fonts (In total commander default viewer is possible see the fonts and their paths). So I am not sure why pdf generation goes oke and I get pdf/A-1b document with this one error. Thank you for response. Great Regards Martin -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41014.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Loading fonts problem
Thank you for your response. I am trying to generate PDF/A-1b document using FOP 0.95. I know that the version is very old but it is very hard to upgrade because noone wants to pay for it such amount of money for retesting all templates (Bank). I am struggeling with embedding fonts into pdf file. I get error below from adobe acrobat <http://apache-fop.1065347.n5.nabble.com/file/n41013/preflight_verification.gif> my fop.xconf is here https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf <https://www.dropbox.com/s/42y70t37ttdv5g6/fop.xconf> I´ve also created report from adobe acrobat which can be usefull. https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf <https://www.dropbox.com/s/9isf4oo7u0hq6pq/doc_report.pdf> and doc.pdf is here https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf <https://www.dropbox.com/s/y17s2osoljmmh9s/doc.pdf> Thank you for response. I hope I´ve provided enough info. Great Regards Martin Klapec -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009p41013.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Loading fonts problem
Hi, To prevent FOP from using font cache, you can configure FOP to deactivate it: just add this in your configuration file: false Notes: Metric files are deprecated since FOP 1.0. With FOP 0.94 et 0.95, such files were usefull only if you wanted to only reference fonts, not embed them in PDF. Since FOP 1.0, there is a command line tool to get font list: org.apache.fop.tools.fontlist.FontListMain 2014-08-04 14:07 GMT+02:00 MartinKl : > Hello, > I have problems with loading fonts and the default fonts are used instead. > I´ve generated fonts metrics using TTFReader which is in FOP0.95. Then I > paste to our application and configured paths to it. > > > > > > weight="normal"/> > ... > > but everytime I run document generation from our application I always found > all fonts from config file in op-fonts.cache which means the fonts were not > loaded and wont be loaded againg. > > I would like to ask if there a way how to get more information about the > problem? Some extended logging? Because I do not get what is wrong with it. > > Thank you for your response. > > Great Regards > MartinKl > > > > -- > View this message in context: > http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > -- pascal - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Loading fonts problem
Hello, it would be easier for people to help you if you provide more information (configuration, fo and output file ). http://xmlgraphics.apache.org/fop/0.95/fonts.html#registerhave some info about font configuration in case you have not seen it already. Thanks in advance Thanasis > Date: Mon, 4 Aug 2014 05:07:18 -0700 > From: klapec.mar...@hotmail.com > To: fop-users@xmlgraphics.apache.org > Subject: Loading fonts problem > > Hello, > I have problems with loading fonts and the default fonts are used instead. > I´ve generated fonts metrics using TTFReader which is in FOP0.95. Then I > paste to our application and configured paths to it. > > > > > > weight="normal"/> > ... > > but everytime I run document generation from our application I always found > all fonts from config file in op-fonts.cache which means the fonts were not > loaded and wont be loaded againg. > > I would like to ask if there a way how to get more information about the > problem? Some extended logging? Because I do not get what is wrong with it. > > Thank you for your response. > > Great Regards > MartinKl > > > > -- > View this message in context: > http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org >
Loading fonts problem
Hello, I have problems with loading fonts and the default fonts are used instead. I´ve generated fonts metrics using TTFReader which is in FOP0.95. Then I paste to our application and configured paths to it. ... but everytime I run document generation from our application I always found all fonts from config file in op-fonts.cache which means the fonts were not loaded and wont be loaded againg. I would like to ask if there a way how to get more information about the problem? Some extended logging? Because I do not get what is wrong with it. Thank you for your response. Great Regards MartinKl -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Loading-fonts-problem-tp41009.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
referenced fonts configuration
Hello everyone, We have been trying to properly configure FOP to generate pdf's with referenced fonts, so that we can avoid the legal problems that would arise if we embedded certain fonts. In the documentation it seems to be pretty straightforward: And then it would reference all possible fonts installed in the consumer's system. Then, in the xslt, the font has to be referenced using the font family name, if I understood correctly. My question is: is there anything else that has to be done for this to work? Do I have to add something else apart from that in the fop config? Thank you! -- View this message in context: http://apache-fop.1065347.n5.nabble.com/referenced-fonts-configuration-tp40727.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: PDF rendering (and SVG-in-PDF rendering) of Arabic fonts not working correctly with ligatures for many fonts
Arabic is not presently supported in SVG when using FOP. For direct FOP use (not SVG), then if you are using any version of FOP prior to FOP 1.1, Arabic is not supported. If you are using 1.1 or current dev build, then you are doing something wrong. You need to provide more details. On Wed, May 14, 2014 at 11:08 AM, Robert Gurol wrote: > Hi all, > > for rendering PDF containing both Arabic text and SVG containing arabic > text, I recently experimented with different fonts. > > Except for the Tahoma font (which I'd rather not use for its license > restrictions), Arabic text is rendered without ligatures, i.e. the letters > of words are displayed as if they were written alone, while Arabic demands > they be rendered differently inside of words and at the beginning and end > of words, so they apper connected like hand-written text. > > That even though most fonts I tried seem to work perfectly well with PNG > transcoding (when registered with the GraphicsEnvironment beforehand), > generating Arabic text as expected. > > The fonts I tried so far are Lateef, Scheherazade and (Wikipedia-used) > Amiri. > Amiri (Regular) contains almost all characters of the unicode character > sets Arabic, Arabic Supplement, Arabic Presentation Forms A and Arabic > Presentation Forms B. > > As far as I know, ArabicTextHandler tries to replace adjacent letters with > the respective connected forms and annotates the characters (not: code > points, alas) with the respective in-word-position information for the > letter, and it is called in both PNG transcoding and SVG-in-PDF transcoding. > However, PNG looks much better in all cases, the ligatures seem to work > only there. > > Is this a known issue? > > If not, I will gladly provide more information and test resources. > > Regards, > > Robert >
PDF rendering (and SVG-in-PDF rendering) of Arabic fonts not working correctly with ligatures for many fonts
Hi all, for rendering PDF containing both Arabic text and SVG containing arabic text, I recently experimented with different fonts. Except for the Tahoma font (which I'd rather not use for its license restrictions), Arabic text is rendered without ligatures, i.e. the letters of words are displayed as if they were written alone, while Arabic demands they be rendered differently inside of words and at the beginning and end of words, so they apper connected like hand-written text. That even though most fonts I tried seem to work perfectly well with PNG transcoding (when registered with the GraphicsEnvironment beforehand), generating Arabic text as expected. The fonts I tried so far are Lateef, Scheherazade and (Wikipedia-used) Amiri. Amiri (Regular) contains almost all characters of the unicode character sets Arabic, Arabic Supplement, Arabic Presentation Forms A and Arabic Presentation Forms B. As far as I know, ArabicTextHandler tries to replace adjacent letters with the respective connected forms and annotates the characters (not: code points, alas) with the respective in-word-position information for the letter, and it is called in both PNG transcoding and SVG-in-PDF transcoding. However, PNG looks much better in all cases, the ligatures seem to work only there. Is this a known issue? If not, I will gladly provide more information and test resources. Regards, Robert
Re: AFP special characters from Windows TTF fonts
Hey Rob, It's generally best practice to ask fop-specific questions the fop-users mailing list, that way you'll get much better support by the community at large rather than a single person. As to your question, honestly I've barely worked on AFP or FOP for that matter in a while and wouldn't be confident answering your question. Maybe one of the other guys can help? Apologies for not being particularly useful, Mehdi On 4 April 2014 16:04, Ron Snyder wrote: > Hello Medhi, > > > > I wanted to reach out to you and see if you can provide me with technical > notes on how Apache FOP determines mapping of Windows TTF characters to AFP > output. > > > > I have been researching and reading various articles on the latest mapping > (no longer using EBCDIC but UTF16) > > > > My ultimate goal is to get âhollow bulletâ character in Calibri TTF font > to output to PDF and AFP using the same encoding. I am somewhat familiar > with how to write the parameters to define AFP fonts in FOP.XCONF. > > > > Can you validate my assumptions of how FOP determines characters from > window TTF fonts to FOP AFP rendered output? > > > > (based on section of code from FOP.XCONF below) > > > > codepage="T100ANSI" encoding="Cp500"> > > characterset="C0CA08NP"/> > > characterset="C0CA10NP"/> > > characterset="C0CA12NP"/> > > characterset="C0CA13NP"/> > > characterset="C0CA14NP"/> > > > > style="normal" weight="normal"/> > > > > > > > > codepage="T100ANSI" encoding="Cp1252"> > > characterset="C0CA08BP"/> > > characterset="C0CA10BP"/> > > characterset="C0CA12BP"/> > > characterset="C0CA13BP"/> > > characterset="C0CA14BP"/> > > > > style="normal" weight="normal"/> > > > > > > > > 1. By using the mapping for the âBulletâ and encoding=âcp500â, the > mappings are based on EBCDIC (because cp500 is based on EBCDIC) and use the > CODE points within the cp500 to map to matching Code Points with the > T100ANSI, determining the equivalent hexadecimal point of the character > (and T100ANSI is EBCDIC based) â (U25CB) â (U2022) ¡ (U00B7) (based on > cp500 U2022 and U00B7 are included in the AFP character set and based on > T100ANSI only U00B7 is available to be output to AFP. > > 2. Where are the cp500 and cp1252 files located in FOP? > > 3. Can âcustomâ encoding files be used? (where should these be > located?) > > 4. By using the mapping for the âBulletâ and encoding=âcp1252â, the > mappings are based on ASCII (because cp1252 is based on ASCII keyboard > mappings) and use the CODE points within the cp500 to map to matching Code > Points with the T100ANSI, determining the equivalent hexadecimal point of > the character (and T100ANSI is EBCDIC based) â (U25CB) â (U2022) ¡ (U00B7) > (based on cp1252 U2022 and U00B7 are included in the AFP character set and > based on T100ANSI only U00B7 is available to be output to AFP. (where does > ASCII to EBCDIC conversion take place?) > note that all characters â (U25CB) â (U2022) ¡ (U00B7) output correctly to > PDF, but only U00B7 outputs to AFP > > > > If you are not the correct person to obtain this information can you > provide me with the contact information of the person I should be reaching > out to? > > > > Thanks, > > Ron > > > > The information transmitted is intended only for the person or entity to > which it is addressed > and may contain CONFIDENTIAL material. If you receive this > material/information in error, > please contact the sender and delete or destroy the material/information. >
Re: distributing fonts with web application
Hey, that's a good idea! Thanks! Hälsningar Martin > 3 dec 2013 kl. 17:41 skrev "Registar Man" : > > Hi, > > I was have the same problem and my solution is: > The web application modifiers the config file's all directory node's value to > the correct path getting from system before start one FOP job. > I don't use FOP too much times per hour. > > Bye, Csaba > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org > - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: distributing fonts with web application
Hi, I was have the same problem and my solution is: The web application modifiers the config file's all directory node's value to the correct path getting from system before start one FOP job. I don't use FOP too much times per hour. Bye, Csaba - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
distributing fonts with web application
Hi, We're making a web application that includes fop and we would like to distribute fonts to be used by fop. I've configured the following in config.xml to be able to use our fonts: WEB-INF/xsl-fo/fonts But anything but an absolute path in does not work. It seems that FOP is not able to get fonts from a relative path with the directive. It does not use the baseURL or fontManager.fontBaseURL. Since I don't know which path the application will be deployed to I'm wondering if anybody has a solution to this. I can't modify the path manually after deployment, and installing the fonts on the server separately from the web application is not a good option either. Thanks in advance, Martin
Re: Custom fonts in Apache FOP (used with Saxon in Eclipse)
Hi, The option is always detect the operating system's installed fonts as described here: http://xmlgraphics.apache.org/fop/1.1/fonts.html#bulk. Use instead under section, and may can use ( http://xmlgraphics.apache.org/fop/1.1/configuration.html) under root node to specify the custom font's path for use with the exact font configuration by node's embed-url attribute! The exact configuration may need only if rendering your font's have some failure. For other custom fonts simply use the option. Bye, Csaba - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Custom fonts in Apache FOP (used with Saxon in Eclipse)
Do not use auto-detect. Instead configure the fonts as shown here: http://xmlgraphics.apache.org/fop/trunk/fonts.html#register. The instructions are for trunk but this works the same in 1.1. On 11/26/13, 9:38 AM, FJMan wrote: The fop.xconf looks like this: flate -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Custom-fonts-in-Apache-FOP-used-with-Saxon-in-Eclipse-tp39692p39693.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Re: Custom fonts in Apache FOP (used with Saxon in Eclipse)
The fop.xconf looks like this: flate -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Custom-fonts-in-Apache-FOP-used-with-Saxon-in-Eclipse-tp39692p39693.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
Custom fonts in Apache FOP (used with Saxon in Eclipse)
Hello! I tried scubscribing to the mailing list a couple of times now but every time I get a mailer daemon. So i hope this even gets posted. I downloaded Apache FOP 1.1 and Saxon9he and included Saxon as XSLT processor into FOP (instead of Xalan) and then built it with ant. I then included the fop.jar (and other necessary jars) into Eclipse to use FOP as fo-processor in my Java-file. The problem now is that I need to use custom fonts (Arial, Courier New). I have tried getting FOP to use custom fonts but so far, without luck. My fop.xonf looks like this: flate I tried to transform via the command line with the -c fop.xonf as a parameter. Neither the autodetect nor telling fop the location of the fonts works. It just uses Helvetica and other default fonts. And what is more, I cannot use the fop.xonf file as a paramater in the command line in my Java programme. -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Custom-fonts-in-Apache-FOP-used-with-Saxon-in-Eclipse-tp39692.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Fonts and PDF/A: An epic struggle
Great Robert, thanks a lot. Would this work for fonts named "serif" etc? /Hakan -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Fonts-and-PDF-A-An-epic-struggle-tp38827p38829.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org
RE: Fonts and PDF/A: An epic struggle
Hi Hakan, There is this section dealing with font substitutions with FOP: http://xmlgraphics.apache.org/fop/trunk/fonts.html#font_substitution That should explain most of what you asked, but I'll run through a quick example of how FOP fonts are roughly configured and can be substituted. In the *.xconf file, you'll have fonts in each section that configured like the following for TTF: SomeFont (in bold) will be the name by which the font can now be referred. It doesn't have to match the name of the font, but can be anything. To reference that font from the FO, you would use Hello World Therefore, to substitute that with another font, you can declare the following in the xconf: Times in this case would be the replacement font. The replacement can either be a base 14 (system font) or one that is declared like SomeFont is in the xconf. Hope this helps, Robert Meyer > Date: Fri, 28 Jun 2013 06:12:43 -0700 > From: programvaruverks...@yahoo.se > To: fop-users@xmlgraphics.apache.org > Subject: Fonts and PDF/A: An epic struggle > > Hi, > > I have problems generating PDF/A. The questions are at the end. I've had an > intense struggle with fonts. > > 1. Generating a plain PDF is no problem. > 2. Add -pdfprofile PDF/A-1b and FOP tells you: /all fonts, even the base 14 > fonts, have to be embedded! Offending font: /Helvetica/ (the exclamation > mark means it yells) > 3. Why is there a slash in the font name in the exception message? Is it > significant? > 4. The exception and the doco seem to say, go get yourself the 14 base fonts > and have them embedded. > 5. I don't want to license the original fonts so I write a fop.config with > the fonts I wish to use (Liberation) + a set of substitution elements, > substituting Helvetica, Times (and Times-Roman), Courier to the > corresponding Liberation. > 6. No improvement, FOP still yells about embedding the base 14 fonts. > 7. Gradually I discover that embedding the base 14 fonts may not be > necessary at all. A more accurate requirement is: You have to embed whatever > fonts are found in your FO file. > 8. Originally the FO file contained generic font names like "serif" and > "sans-serif". I tried to configure substitutions for them, but no luck. > 9. After making sure the FO only contains Liberation fonts everything JUST > WORKS. > > Even though I have spent too many hours on this, I still don't have the big > picture. I wish somebody could tell the story from beginning to end. The FOP > documentation is bits and pieces. It's a pity because FOP itself is awesome. > Questions: > > -- Given a FO file, is there any way to configure FOP to substitute fonts > for those defined in the FO? > -- If the FO contains generic names like "serif" how does FOP select a > specific font? Is it possible to configure substitutions for them? > -- What is font substitution in the FOP config used for? Does it have any > effect? > > /Hakan > > > > -- > View this message in context: > http://apache-fop.1065347.n5.nabble.com/Fonts-and-PDF-A-An-epic-struggle-tp38827.html > Sent from the FOP - Users mailing list archive at Nabble.com. > > - > To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org > For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org >
Fonts and PDF/A: An epic struggle
Hi, I have problems generating PDF/A. The questions are at the end. I've had an intense struggle with fonts. 1. Generating a plain PDF is no problem. 2. Add -pdfprofile PDF/A-1b and FOP tells you: /all fonts, even the base 14 fonts, have to be embedded! Offending font: /Helvetica/ (the exclamation mark means it yells) 3. Why is there a slash in the font name in the exception message? Is it significant? 4. The exception and the doco seem to say, go get yourself the 14 base fonts and have them embedded. 5. I don't want to license the original fonts so I write a fop.config with the fonts I wish to use (Liberation) + a set of substitution elements, substituting Helvetica, Times (and Times-Roman), Courier to the corresponding Liberation. 6. No improvement, FOP still yells about embedding the base 14 fonts. 7. Gradually I discover that embedding the base 14 fonts may not be necessary at all. A more accurate requirement is: You have to embed whatever fonts are found in your FO file. 8. Originally the FO file contained generic font names like "serif" and "sans-serif". I tried to configure substitutions for them, but no luck. 9. After making sure the FO only contains Liberation fonts everything JUST WORKS. Even though I have spent too many hours on this, I still don't have the big picture. I wish somebody could tell the story from beginning to end. The FOP documentation is bits and pieces. It's a pity because FOP itself is awesome. Questions: -- Given a FO file, is there any way to configure FOP to substitute fonts for those defined in the FO? -- If the FO contains generic names like "serif" how does FOP select a specific font? Is it possible to configure substitutions for them? -- What is font substitution in the FOP config used for? Does it have any effect? /Hakan -- View this message in context: http://apache-fop.1065347.n5.nabble.com/Fonts-and-PDF-A-An-epic-struggle-tp38827.html Sent from the FOP - Users mailing list archive at Nabble.com. - To unsubscribe, e-mail: fop-users-unsubscr...@xmlgraphics.apache.org For additional commands, e-mail: fop-users-h...@xmlgraphics.apache.org