您的位置:首页 > 编程语言 > MATLAB

MATLAB 2010a解决中文字体乱码的方法

2014-08-24 15:15 211 查看
今天在Fedora18中安装了MATLAB 2010a,一切顺利,但最后使用时,发现界面中某些中文显示为方框。在网上搜索了解决方案,特记录下以备后用。 18

首先需要有中文字体,一般情况在File->Preferences->Fonts中进行设置,选择喜欢的中文字体后,如Current Folder、Command History等处的中文就能正常显示。但是在打开文件等处仍然显示为方框,此时需要进行进一步处理。

进入MATLAB 2010a目录,默认为:/usr/local/MATLAB/R2010a

cd /opt/Matlab/sys/java/jre/glnx86/jre/lib/fonts/

mkdir fallback

cd fallback

ln -s /usr/share/fonts/truetype/wqy/wqy-zenhei.ttc ./wqy-zenhei.ttc

mkfontdir

mkfontscale

重启MATLAB就可以看到所有的中文都正常了。

如果不行的话,在fontconfig.properties中加入:

[sunjunior@localhost lib]$ cat fontconfig.properties

# @(#)linux.fontconfig.properties 1.2 03/10/28

#

# Copyright 2003 Sun Microsystems, Inc. All rights reserved.

#

# Version

version=1

# Component Font Mappings

allfonts.chinese-arphic1= -misc-wenquanyi zen hei-medium-r-normal--0-0-0-0-p-0-iso10646-1

filename.-misc-simsun-medium-r-normal--0-0-0-0-p-0-iso10646-1=/opt/MatLab/sys/java/jre/glnx86/jre/lib/fonts/fallback/wqy-zenhei.ttc

# Search Sequences

sequence.fallback=chinese-arphic1

# Exclusion Ranges

# Font File Names
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息