Modifying base-font in Apache FOP PDf transform
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 44
- Joined: Tue Mar 13, 2012 5:01 pm
Modifying base-font in Apache FOP PDf transform
A few years back I made the following note to myself in the DITA-OT file commons.attr.xsl, as a reminder about how I had changed the PDF output base font to sans-serif:
(I added the line containing "sans-serif")
This file used to be in the demo folder, so now I understand that it's at this location instead:
However now when I add the line with sans-serif to the file in that new location, it doesn't seem to change anything.
I remember that I was using XEP back then also, and now I'm using Apache FOP (since XEP doesn't seem to be included in this Oxygen installation that I'm using), is that the difference?
I tried adding the above to ....cfg\fo\attrs\custom.xsl also, but no change that way either.
Anyone know how to do this or why my previous method doesn't work? It did work back then, that I remember.
Thanks,
Code: Select all
<!-- added font-family attribute to change the base font to sans serif -->
<xsl:attribute-set name="base-font">
<xsl:attribute name="font-size"><xsl:value-of select="$default-font-size"/></xsl:attribute><xsl:attribute name="font-family">sans-serif</xsl:attribute>
</xsl:attribute-set>
This file used to be in the demo folder, so now I understand that it's at this location instead:
Code: Select all
C:\Developer\SVN\trunk\DITA-OT\plugins\org.dita.pdf2\cfg\fo\attrs\commons.attr.xsl
I remember that I was using XEP back then also, and now I'm using Apache FOP (since XEP doesn't seem to be included in this Oxygen installation that I'm using), is that the difference?
I tried adding the above to ....cfg\fo\attrs\custom.xsl also, but no change that way either.
Anyone know how to do this or why my previous method doesn't work? It did work back then, that I remember.
Thanks,
-
- Posts: 9434
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Modifying base-font in Apache FOP PDf transform
Hi,
To test this behavior I opened the XSLT:
DITA-OT\plugins\org.dita.pdf2\cfg\fo\attrs\commons-attr.xsl
and made the modification to the "base-font" attribute set to use monospace (just to see more clearly the affected text):
and it worked for me (should work with any FO Processor no matter if its Apache FOP or XEP), the paragraph text was rendered with Monospaced.
Could you try the same thing?
If it does not work, maybe you are using another DITA OT installation for publishing.
If it works, you should look in the file:
DITA-OT/plugins/org.dita.pdf2/cfg/fo/font-mappings.xml
and see that the alias "sans-serif" is mapped to a logical font called "Sans" which in turn is mapped to a sequence of physical fonts. Maybe you need to make changes to that sequence.
http://www.oxygenxml.com/doc/ug-oxygen/ ... tails.html
Regards,
Radu
To test this behavior I opened the XSLT:
DITA-OT\plugins\org.dita.pdf2\cfg\fo\attrs\commons-attr.xsl
and made the modification to the "base-font" attribute set to use monospace (just to see more clearly the affected text):
Code: Select all
<xsl:attribute-set name="base-font">
<xsl:attribute name="font-size"><xsl:value-of select="$default-font-size"/></xsl:attribute>
<xsl:attribute name="font-family">monospace</xsl:attribute>
</xsl:attribute-set>
Could you try the same thing?
If it does not work, maybe you are using another DITA OT installation for publishing.
If it works, you should look in the file:
DITA-OT/plugins/org.dita.pdf2/cfg/fo/font-mappings.xml
and see that the alias "sans-serif" is mapped to a logical font called "Sans" which in turn is mapped to a sequence of physical fonts. Maybe you need to make changes to that sequence.
http://www.oxygenxml.com/doc/ug-oxygen/ ... tails.html
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 44
- Joined: Tue Mar 13, 2012 5:01 pm
Re: Modifying base-font in Apache FOP PDf transform
Thanks, that was a good idea to test using monospace. It didn't change anything either, so I investigated and finally discovered that I was pointing to a DITA-OT in a slightly different location.
We have a small complication in that we can't modify anything in the Program Files directories, so I had to make a copy of the Oxygen-included DITA-OT and put it in a place where I have permissions to modify it. Someone had already done that however and put a copy one level below, and that was the one I was pointing Oxygen to, not the one I was modifying.
I have sans-serif now, thanks.
We have a small complication in that we can't modify anything in the Program Files directories, so I had to make a copy of the Oxygen-included DITA-OT and put it in a place where I have permissions to modify it. Someone had already done that however and put a copy one level below, and that was the one I was pointing Oxygen to, not the one I was modifying.
I have sans-serif now, thanks.
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