Unable to use a font - XSL-FO
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 38
- Joined: Thu Jul 29, 2021 12:02 pm
Unable to use a font - XSL-FO
Post by InspectorSpacetime »
Hello,
I'm trying to use a custom TTF font in my PDF publication, but for some reason I just can't get it to work.
The font is installed in the Windows/Fonts folder as usual, and all other programs (Word, etc) are able to find and use it just fine, but when I'm trying to specify my XSL files to use it in my publication, it just doesn't work.
I have checked that the fop.xconf file has <auto-detect/> enabled, so I guess FOP should be able to find the font? I have tried it both with and without the font-mappings.xml file to no avail.
Any help here?
I'm trying to use a custom TTF font in my PDF publication, but for some reason I just can't get it to work.
The font is installed in the Windows/Fonts folder as usual, and all other programs (Word, etc) are able to find and use it just fine, but when I'm trying to specify my XSL files to use it in my publication, it just doesn't work.
I have checked that the fop.xconf file has <auto-detect/> enabled, so I guess FOP should be able to find the font? I have tried it both with and without the font-mappings.xml file to no avail.
Any help here?
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Unable to use a font - XSL-FO
Post by julien_lacour »
Hello,
Is your custom style-sheet working with a Windows default font (like Calibri)?
How do you extend the DITA Map PDF - based on XSL-FO transformation? Are you using a custom plugin?
Are other modifications from the same style-sheet working fine?
Regards,
Julien
Is your custom style-sheet working with a Windows default font (like Calibri)?
How do you extend the DITA Map PDF - based on XSL-FO transformation? Are you using a custom plugin?
Are other modifications from the same style-sheet working fine?
Regards,
Julien
-
- Posts: 38
- Joined: Thu Jul 29, 2021 12:02 pm
Re: Unable to use a font - XSL-FO
Post by InspectorSpacetime »
Hello!
Yes, I am able to use most (I'd say 95%) of the other fonts in the Windows/Fonts folder just fine. All other modifications in the custom stylesheet work as well.
I'm using a custom plugin with the XSL-FO transformation to PDF.
Yes, I am able to use most (I'd say 95%) of the other fonts in the Windows/Fonts folder just fine. All other modifications in the custom stylesheet work as well.
I'm using a custom plugin with the XSL-FO transformation to PDF.
-
- Posts: 38
- Joined: Thu Jul 29, 2021 12:02 pm
Re: Unable to use a font - XSL-FO
Post by InspectorSpacetime »
Actually I solved this one!
I had to install the font by right-clicking and selecting "Install for all users".
Just dragging the font to the Fonts folder or using the "basic" install function was not enough in this case.
I had to install the font by right-clicking and selecting "Install for all users".
Just dragging the font to the Fonts folder or using the "basic" install function was not enough in this case.
-
- Posts: 665
- Joined: Wed Oct 16, 2019 3:47 pm
Re: Unable to use a font - XSL-FO
Post by julien_lacour »
I'm glad you solved the problem, I've found that the font can also be declared in the xconf file together with the <auto-detect> option like this:
Usually with this option, you do not need to install custom fonts.
Code: Select all
<directory recursive="true">C:\path\to\custom\fonts</directory>
-
- Posts: 9
- Joined: Fri Jan 20, 2023 1:05 am
Re: Unable to use a font - XSL-FO
After many many attempts at adjusting the configuration file, this solution worked for me when converting using the Apache FO processor in a Windows 11 environment:
I hope this helps the community.
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<fop version="1.0">
<font-base>file:/Users/timmy/Appdata/Local/Microsoft/Windows/Fonts</font-base>
<source-resolution>120</source-resolution>
<target-resolution>120</target-resolution>
<default-page-settings height="11in" width="8.26in"/>
<renderers>
<renderer mime="application/pdf">
<filterList>
<value>flate</value>
</filterList>
<fonts>
<auto-detect/>
</fonts>
</renderer>
</renderers>
</fop>
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service