Chinese characters shows as #
in generated PDF
#607
Replies: 3 comments 2 replies
-
Browsers (and most OS's) can use a fallback font for individual characters: You define a custom font and if one of the characters you need is not part of that font, the browser/OS will just pick that specific character out of a fallback font. Unlike browsers, FOP (which DAPS currently uses for generating PDFs), cannot pick individual characters out of another font automatically. It only ever uses one font at a time. This means if you need Chinese output, you must define a font that supports Chinese characters up front and that font must be the first one available for FOP to pick (in practical terms, the Chinese font should be the first font listed in your font stack). All of this makes this a stylesheet question. In the SUSE stylesheets we solved the issue by switching out the FO font stack depending on the |
Beta Was this translation helpful? Give feedback.
-
A new DAPS user may not even know what XSL is, and even after a day of trying to hunt down where the "Times-Roman" displayed in
(which I get from
I found
the right way to communicate that to DAPS? Is there a difference between
How do I do that? |
Beta Was this translation helpful? Give feedback.
-
The stylesheets are a bit of an area for experts. You can do a lot with just parameters but bigger layout changes do need XSLT knowledge. As for how to override this value see at the bottom. Usually, the DocBook XSLT stylesheets are installed into
Excellent pointer & I didn't know it yet, but:
The way DAPS creates PDFs is as follows:
This property needs to be generated into the XSL-FO file using the XSLT stylesheet (again, already done by default).
Depends on the stylesheets. If you're using the upstream DocBook stylesheets, you can define font choices in the DC file. The following should give you what you need for Simplified Chinese:
I hope that helps/makes sense. |
Beta Was this translation helpful? Give feedback.
-
Problem description
Just starting on DocBook, via DAPS, and using Unicode in awareness that XML processing is Unicode-based, expecting Unicode characters in documents to work “out of the box” given the general appearence of DAPS, I was quite disappointed to see
Chinese characters (which I need) rendered as
#
in PDF. (I have ample fonts installed (on Ubuntu), and have Chinese working in XeLaTeX.)Expected behavior
Chinese characters should display properly in PDF.
If this is beyond the scope of DAPS, instructions and/or warnings should be included prominently in the DAPS documentation.
Steps to reproduce problem
Notice the
##
in the “Example ordered list”.Beta Was this translation helpful? Give feedback.
All reactions