Multilingual Topic in PDF2
Here should go questions about transforming XML with XSLT and FOP.
-
- Posts: 171
- Joined: Thu Aug 30, 2018 10:06 pm
Multilingual Topic in PDF2
Post by dreifsnider »
I have a DITA topic that contains both English and Japanese characters.
I'm using a custom pdf2 plugin in the dita-ot 3.1, which I believe is using apache fop 2.3.
My font-mappings.xml for the applicable font-family is:
I've set the xml:lang="ja-JP" attribute on the applicable elements; however, the Japanese characters are rendering as #, which I believe Apache FOP is doing for missing glyphs.
I'm thinking that FOP is setting the entire topic to EN, and ignoring the xml:lang attribute on the elements. I know that the font being used for the default char-set does not contain Japanese glyphs, but I would expect the xml:lang attribute to be preserved and the char-set for the applicable elements to be set to Japanese.
Is it possible to use two different fonts (one font for the English glyphs, another for the Japanese glyphs) for a topic in a PDF output?
Thank you!
Daniel
I'm using a custom pdf2 plugin in the dita-ot 3.1, which I believe is using apache fop 2.3.
My font-mappings.xml for the applicable font-family is:
Code: Select all
<logical-font name="SST-Bold">
<physical-font char-set="default">
<font-face>SST-Bold</font-face>
</physical-font>
<physical-font char-set="Japanese">
<font-face>SSTJpPro-Bold</font-face>
</physical-font>
</logical-font>
I'm thinking that FOP is setting the entire topic to EN, and ignoring the xml:lang attribute on the elements. I know that the font being used for the default char-set does not contain Japanese glyphs, but I would expect the xml:lang attribute to be preserved and the char-set for the applicable elements to be set to Japanese.
Is it possible to use two different fonts (one font for the English glyphs, another for the Japanese glyphs) for a topic in a PDF output?
Thank you!
Daniel
-
- Posts: 9431
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Multilingual Topic in PDF2
Hi Daniel,
As far as I know the classic PDF output does not properly support outputting two languages in the same PDF. This is not a limitation in the Apache FOP PDF engine but in the DITA OT PDF plugin.
But you can try to register on the DITA Users List and ask around, maybe they know more about that than I do.
As workarounds:
1) In the last couple of years we added in Oxygen a new way to obtain PDF from DITA using CSS for styling:
https://www.oxygenxml.com/doc/versions/ ... 5-x-2.html
and using this CSS-based approach you would just need to write selectors similar to this:
2) Antenna House has a custom DITA OT plugin which supports from what I know multiple languages in the same PDF:
https://github.com/AntennaHouse/pdf5
but it only works with their commercial Antenna House engine.
Regards,
Radu
As far as I know the classic PDF output does not properly support outputting two languages in the same PDF. This is not a limitation in the Apache FOP PDF engine but in the DITA OT PDF plugin.
But you can try to register on the DITA Users List and ask around, maybe they know more about that than I do.
As workarounds:
1) In the last couple of years we added in Oxygen a new way to obtain PDF from DITA using CSS for styling:
https://www.oxygenxml.com/doc/versions/ ... 5-x-2.html
and using this CSS-based approach you would just need to write selectors similar to this:
Code: Select all
*:lang(ja) {
font-family: "SSTJpPro" !important;
}
https://github.com/AntennaHouse/pdf5
but it only works with their commercial Antenna House engine.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 171
- Joined: Thu Aug 30, 2018 10:06 pm
Re: Multilingual Topic in PDF2
Post by dreifsnider »
Thanks for your help once again Radu!
I'll ask on the DITA Users Group and see if I get a response.
I did see this existing issue in the dita-ot github source: https://github.com/dita-ot/dita-ot/issues/1250 but I wasn't sure if it's still relevant.
My team is heavily investigating moving over to using Oxygen's PDF Chemistry, but for the moment we're stuck with xsl:fo and FOP.
Thanks again!
Daniel
I'll ask on the DITA Users Group and see if I get a response.
I did see this existing issue in the dita-ot github source: https://github.com/dita-ot/dita-ot/issues/1250 but I wasn't sure if it's still relevant.
My team is heavily investigating moving over to using Oxygen's PDF Chemistry, but for the moment we're stuck with xsl:fo and FOP.
Thanks again!
Daniel
-
- Posts: 171
- Joined: Thu Aug 30, 2018 10:06 pm
Re: Multilingual Topic in PDF2
Post by dreifsnider »
For what it's worth, I took a look on the Yahoo DITA Users Group, and came across this post by Aliza:
https://groups.yahoo.com/neo/groups/dit ... ages/43256
I added the Japanese char-sets to the en.xml i18n and the Japanese glyphs now correctly display alongside the English.
Cheers!
Daniel
https://groups.yahoo.com/neo/groups/dit ... ages/43256
I added the Japanese char-sets to the en.xml i18n and the Japanese glyphs now correctly display alongside the English.
Cheers!
Daniel
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