Tomcat program run Java program, when exporting pictures, will appear in Chinese garbled, also to Tomcat Server.xml specified uriencoding= "UTF-8" parameter, also invalid.
This is because Tomcat is requesting a system font when processing a program, so it must have a Chinese font in order to handle Chinese correctly.
1. Under/usr/share/fonts/, create a new folder Winfonts, and then copy the Win7 font Msyh.ttf and Msyhbd.ttf to ubuntu/usr/share/fonts/.
2. Install fonts
# sudo chmod 664/usr/share/fonts/winfonts/*
# cd/usr/share/fonts/winfonts/
# sudo Mkfontscale
# sudo Mkfontdir
# sudo FC-CACHE-FV #建立字体缓存信息
3. See if the success
# FC-LIST:LANG=ZH-CN #如果成功就会有如下信息, and then reboot Tomcat without garbled.
Microsoft Yahei, Microsoft Black: Style=regular,normal,obyejné,standard,κανονικ,normaali,normál,normale,standaard,normalny, Обычный,normálne,navadno,arrunta
Microsoft Yahei, Microsoft Black: Style=bold,negreta,tuné,fed,fett,ντονα,negrita,lihavoitu,gras,félkvér,grassetto,vet, Halvfet,pogrubiony,negrito,полужирный,fet,kaln,krepko,lodia
This article is from the "Penguin" blog, please be sure to keep this source http://lizhenliang.blog.51cto.com/7876557/1600438
Ubuntu12.04 Installing Chinese fonts