Why the font display

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
hedyhan
Posts: 19
Joined: Tue Mar 27, 2018 3:46 pm

Why the font display

Post by hedyhan » Fri Mar 29, 2019 10:47 am

I want to change my default Simplified Chinese Font to "Source Han Sans CN", but in the output of PDF, the partial of characters does not to be displayed.

I change the font-mappings.xml file, the relevant codes like below:

<logical-font name="Serif">
<physical-font char-set="Source Han Sans CN">
<font-face>Source Han Sans CN, Times New Roman, Times, Arial Unicode MS, Tahoma, Batang, SimSun</font-face>
</physical-font>
<physical-font char-set="Simplified Chinese">
<font-face>Source Han Sans CN, Microsoft YaHei, AdobeSongStd-Light, Arial Unicode MS, Batang, SimSun</font-face>
</physical-font>

Can anyone give me a help?

Radu
Posts: 7099
Joined: Fri Jul 09, 2004 5:18 pm

Re: Why the font display

Post by Radu » Fri Mar 29, 2019 4:37 pm

Hi,

Have you set the xml:lang attribute to "ch" on all the topics and maps?
Do your changes seem to work at all? For example do they work for the body of text but not for the titles?
Maybe you should perform the same changes on the "<logical-font name="Sans">" and "<logical-font name="Monospaced">" logical font definitions.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

hedyhan
Posts: 19
Joined: Tue Mar 27, 2018 3:46 pm

Re: Why the font display

Post by hedyhan » Tue Apr 02, 2019 10:13 am

Radu wrote:
Fri Mar 29, 2019 4:37 pm
Hi,

Have you set the xml:lang attribute to "ch" on all the topics and maps?
Do your changes seem to work at all? For example do they work for the body of text but not for the titles?
Maybe you should perform the same changes on the "<logical-font name="Sans">" and "<logical-font name="Monospaced">" logical font definitions.

Regards,
Radu
Yes, the above two operations I have done, but it still cannot solve the problem.

Radu
Posts: 7099
Joined: Fri Jul 09, 2004 5:18 pm

Re: Why the font display

Post by Radu » Tue Apr 02, 2019 2:29 pm

Hi,

About my previous suggestion:
Have you set the xml:lang attribute to "ch" on all the topics and maps?
Actually the language XML attribute needs to be set to xml:lang=zh-CN" on all the root elements from all DITA maps and topics. Can you do that and try again?

If that does not work:
What Oxygen version are you using?
Are you publishing using Oxygen's bundled DITA Open Toolkit or a custom DITA Open Toolkit installation?
For example Oxygen 21 comes bundled with DITA OT 3.2.1 which uses SimSun as the default font used for Chinese content in the font-mappings.xml:

Code: Select all

<font-mappings>
<font-table>

<!-- Backwards compatibility aliases -->
<aliases>
<alias name="serif">Serif</alias>
</aliases>
<aliases>
<alias name="sans-serif">Sans</alias>
</aliases>
<aliases>
<alias name="monospace">Monospaced</alias>
</aliases>
<aliases>
<alias name="Helvetica">Normal</alias>
</aliases>
<aliases>
<alias name="Courier">Monospaced</alias>
</aliases>

<logical-font name="Sans">
<physical-font char-set="default">
<font-face>Helvetica, Arial Unicode MS, Tahoma, Batang, SimSun</font-face>
</physical-font>
<physical-font char-set="Simplified Chinese">
<font-face>AdobeSongStd-Light, Arial Unicode MS, Batang, SimSun</font-face>
</physical-font>
<physical-font char-set="Japanese">
<font-face>KozMinProVI-Regular, Arial Unicode MS, Batang</font-face>
</physical-font>
<physical-font char-set="Korean">
<font-face>AdobeMyungjoStd-Medium, Arial Unicode MS, Batang</font-face>
</physical-font>
<physical-font char-set="Symbols">
<font-face>ZapfDingbats</font-face>
</physical-font>
<physical-font char-set="SubmenuSymbol">
<font-face>ZapfDingbats</font-face>
</physical-font>
<physical-font char-set="SymbolsSuperscript">
<font-face>Helvetica, Arial Unicode MS</font-face>
<baseline-shift>20%</baseline-shift>
<override-size>smaller</override-size>
</physical-font>
</logical-font>

<logical-font name="Serif">
<physical-font char-set="default">
<font-face>Times New Roman, Times, Arial Unicode MS, Tahoma, Batang, SimSun</font-face>
</physical-font>
<physical-font char-set="Simplified Chinese">
<font-face>AdobeSongStd-Light, Arial Unicode MS, Batang, SimSun</font-face>
</physical-font>
<physical-font char-set="Japanese">
<font-face>KozMinProVI-Regular, Arial Unicode MS, Batang</font-face>
</physical-font>
<physical-font char-set="Korean">
<font-face>AdobeMyungjoStd-Medium, Arial Unicode MS, Batang</font-face>
</physical-font>
<physical-font char-set="Symbols">
<font-face>ZapfDingbats</font-face>
</physical-font>
<physical-font char-set="SubmenuSymbol">
<font-face>ZapfDingbats</font-face>
</physical-font>
<physical-font char-set="SymbolsSuperscript">
<font-face>Times New Roman, Times, Arial Unicode MS, Tahoma, Batang</font-face>
<baseline-shift>20%</baseline-shift>
<override-size>smaller</override-size>
</physical-font>
</logical-font>

<logical-font name="Monospaced">
<physical-font char-set="default">
<font-face>Courier New, Courier, Arial Unicode MS, Tahoma, Batang, SimSun</font-face>
</physical-font>
<physical-font char-set="Simplified Chinese">
<font-face>AdobeSongStd-Light, Arial Unicode MS, Batang, SimSun</font-face>
</physical-font>
<physical-font char-set="Japanese">
<font-face>KozMinProVI-Regular, Arial Unicode MS, Batang</font-face>
</physical-font>
<physical-font char-set="Korean">
<font-face>AdobeMyungjoStd-Medium, Arial Unicode MS, Batang</font-face>
</physical-font>
<physical-font char-set="Symbols">
<font-face>ZapfDingbats</font-face>
</physical-font>
<physical-font char-set="SymbolsSuperscript">
<font-face>Courier New, Courier, Arial Unicode MS, Tahoma, Batang</font-face>
<baseline-shift>20%</baseline-shift>
<override-size>smaller</override-size>
</physical-font>
</logical-font>
</font-table>

</font-mappings>
and such a mapping works for me out of the box to display Chinese characters.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

hedyhan
Posts: 19
Joined: Tue Mar 27, 2018 3:46 pm

Re: Why the font display

Post by hedyhan » Wed Apr 10, 2019 10:30 am

Hi ,

Thanks for your reply.

In your example, why do you say " SimSun as the default font used for Chinese content" ? Why not Arial Unicode MS? how to identify?

Radu
Posts: 7099
Joined: Fri Jul 09, 2004 5:18 pm

Re: Why the font display

Post by Radu » Thu Apr 11, 2019 1:31 pm

Hi,

I think I expressed this wrong. If you specify a font face like this:

Code: Select all

<font-face>Helvetica, Arial Unicode MS, Tahoma, Batang, SimSun</font-face>
it means that all these fonts are used as fallbacks, iterated from left to right.
So if the PDF processor wants to display a certain character, if "Helvetica" supports it then it is used, otherwise the next font is tested and so on. So in this case "SimSun" is the last fallback font, used only when the fonts before it cannot be used to render a certain character.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com

Post Reply