Enable weston-terminal support display Chinese character

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Enable weston-terminal support display Chinese character

Enable weston-terminal support display Chinese character

The native Yocto not support chinese, so need to add chinese font .

The first step should download Chinese font  files such as  MSYHMONO.ttf and DroidSansFallback.ttf.Then copy

fonts files to /usr/share/fonts/truetype and run command  fc-cache .update font cache.

use fc-list :lang=zh can see which Chinese fonts are installed:

         /usr/share/fonts/truetype/MSYHMONO.ttf: Microsoft YaHei Mono:style=Regular
         /usr/share/fonts/truetype/DroidSansFallbackFull.ttf: Droid Sans Fallback:style=Regular

The secend step is to change default fonts. In weston-terminal.c we can see:

          3119   weston_config_section_get_string(s, "font", &option_font, "mono");
          3120   weston_config_section_get_int(s, "font-size", &option_font_size, 14);

 weston-terminal default use mono font.Just to modify /etc/fonts/fonts.conf

          <edit name="family" mode="assign" binding="same">

                      <string>monospace</string>

to   <string>Microsoft YaHei Mono</string> or <string>Droid Sans Fallback</string> could display Chinese character

 

But it have some problem such like as :

nxp3.jpg NXP2.jpg

the left use Microsoft YaHei Mono font the Chinese character is overlapping ,the right use Droid Sans Fallback font is en-font could not display.

If you have a better way to welcome a message!

Attachments
No ratings
Version history
Last update:
‎12-04-2018 05:46 AM
Updated by: