Reputation: 19
I need to display data on an advanced PDF where the field contains both English and Chinese characters. English displays fine, but Chinese is not appearing. What are some options for getting the Chinese characters to also appear?
Upvotes: 1
Views: 2720
Reputation: 88
<link name="Amiri-font" type="font" subtype="opentype" src="https://system.eu2.netsuite.com/core/media/media.nl?id=6855&c=xxx8839&h=7cada88647a1f0c07899&_xt=.ttf" src-bold="https://xxx8839-sb1.app.netsuite.com/core/media/media.nl?id=7532&c=xxx8839&h=97e9854d5b5e8f891e11&_xt=.ttf" bytes="2" />
<style>
.fontA{
font-size:14pt;
font-family: Amiri-font, sans-serif;
}
</style>
Here is how we used the font for Arabic font use tag with downloaded font file
Upvotes: 0
Reputation: 281
Upload the .ttf file of the Chinese language in the file cabinet and call it in the tag in advanced PDF. I always tried it and it worked.
Upvotes: 0
Reputation: 3783
NetSuite uses a library called BFO under the hood to render PDFs. The User Guide from page 30 details on how to use built-in fonts as well as embedding your own.
As well as the standard 5 fonts, users with the appropriate language version of Acrobat can access up to 7 further fonts to display Chinese, Japanese and Korean text. The names for these fonts are “stsong” (STSong-Light, simplified Chinese), “msung” (MSungLight, traditional Chinese), “mhei” (MHei-Medium, traditional Chinese), “heiseimin” (HeiseiMin-W3, Japanese), “heiseikakugo” (HeiseiKakuGo-W5, Japanese), “hygothic” (HYGoThic-Medium, Korean) and “hysmyeongjo” (HYSMyeongJo-Medium, Korean)
Also have a look at the built-in NetSuite templates as they automatically embed some fonts based on the locale. If you just remove the <#if>
code around the Chinese that might do the trick.
<link name="NotoSans" type="font" subtype="truetype" src="${nsfont.NotoSans_Regular}" src-bold="${nsfont.NotoSans_Bold}" src-italic="${nsfont.NotoSans_Italic}" src-bolditalic="${nsfont.NotoSans_BoldItalic}" bytes="2" />
<#if .locale == "zh_CN">
<link name="NotoSansCJKsc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKsc_Regular}" src-bold="${nsfont.NotoSansCJKsc_Bold}" bytes="2" />
<#elseif .locale == "zh_TW">
<link name="NotoSansCJKtc" type="font" subtype="opentype" src="${nsfont.NotoSansCJKtc_Regular}" src-bold="${nsfont.NotoSansCJKtc_Bold}" bytes="2" />
<#elseif .locale == "ja_JP">
<link name="NotoSansCJKjp" type="font" subtype="opentype" src="${nsfont.NotoSansCJKjp_Regular}" src-bold="${nsfont.NotoSansCJKjp_Bold}" bytes="2" />
<#elseif .locale == "ko_KR">
<link name="NotoSansCJKkr" type="font" subtype="opentype" src="${nsfont.NotoSansCJKkr_Regular}" src-bold="${nsfont.NotoSansCJKkr_Bold}" bytes="2" />
<#elseif .locale == "th_TH">
<link name="NotoSansThai" type="font" subtype="opentype" src="${nsfont.NotoSansThai_Regular}" src-bold="${nsfont.NotoSansThai_Bold}" bytes="2" />
</#if>
Upvotes: 1