Expand my Community achievements bar.

SOLVED

Font Mapping by Language

Avatar

Level 6
I searched through the online documentation, but I'm not finding instructions for defining fonts by language.
 
For example, for all our Native PDF Publishing outputs, we're using Arial.
 
It is looking like I need to assign the following languages to different fonts:
Simplified Chinese: MicrosoftJhengHeiUI
Traditional Chinese: MicrosoftJhengHeiUI
 
Some of the punctuation for Simplified Chinese is correct with the correct spacing, but our outputs are using the European double-quote spacing instead of the wider Chinese spacing. When I copy/paste from a translated PDF into Word, the text is in a mix of MS Gothic, Arial, and MicrosoftJhengHeiUI. The fonts embedded in the PDF include Nanum Gothic (which is supposed to be for Korean?).
 
I know where the language mapping/aliasing is done for our older DITA-OT system, but I'm not seeing the settings for AEM Guides with Native PDF Publishing. What am I missing? Where are the fonts for Asian languages defined for Native PDF Publishing outputs?
 
Or maybe the better question is why are periods, commas, paranthesis, etc all in the "correct" Simplified Chinese font, but the double-quotes defined in the language variables not?
1 Accepted Solution

Avatar

Correct answer by
Employee

Hi Susan,

 

You will have to use :lang() class in the css. We have it partially documented on the following page

https://experienceleague.adobe.com/en/docs/experience-manager-guides/using/install-guide/on-prem-ig/...

 

Have something like the following in your content.css file of the PDF template.

 

:lang(en) {
font-family: Arial;
}
:lang(zh-TWzh-CN) {
font-family: MicrosoftJhengHeiUI;
}
:lang(zh-TW) {
font-family: MicrosoftJhengHeiUI;
}

 

You can read more about this on

https://developer.mozilla.org/en-US/docs/Web/CSS/:lang

 

Let us know if this helps.

 

Thanks,

Vivek

View solution in original post

3 Replies

Avatar

Correct answer by
Employee

Hi Susan,

 

You will have to use :lang() class in the css. We have it partially documented on the following page

https://experienceleague.adobe.com/en/docs/experience-manager-guides/using/install-guide/on-prem-ig/...

 

Have something like the following in your content.css file of the PDF template.

 

:lang(en) {
font-family: Arial;
}
:lang(zh-TWzh-CN) {
font-family: MicrosoftJhengHeiUI;
}
:lang(zh-TW) {
font-family: MicrosoftJhengHeiUI;
}

 

You can read more about this on

https://developer.mozilla.org/en-US/docs/Web/CSS/:lang

 

Let us know if this helps.

 

Thanks,

Vivek

Avatar

Level 6

Yes, this did partially help.

 

Do you know why this language mapping worked for 90% of the text within the PDF, but not for the Chinese-specific "" as defined in the Language Variables? Those quotes as used in the on-page variables still appear to be in Arial instead of Microsoft JhengHei and therefore do not have the extra space required by the Chinese languages. (Most of the rest of the PDF is in JhengHei. I'll have to figure out why some of the table content is in Arial and some is in JhengHei.)

Avatar

Employee

Hi Susan,

 

How are you putting quotes? Are you using the <q> element? I doubt if the language variable is the right way to handle quotes. If you use <q> element then by default it will get handled otherwise you can also specify in the CSS file.

 

:lang(en) > q {
  quotes: "\201C" "\201D" "\2018" "\2019";
}
:lang(fr) > q {
  quotes: "« " " »";
}
:lang(de) > q {
  quotes: "»" "«" "\2039" "\203A";
}

See the example on the mozilla page 

https://developer.mozilla.org/en-US/docs/Web/CSS/:lang

 

Otherwise download the temporary merged HTML file and inspect in the browser where the quote style is coming from. You can use this to find out for your TOC as well.

 

Thanks,

Vivek