树莓派——显示中文

树莓派默认是采用英文字库的,而且系统里没有预装中文字库,所以即使你在locale中改成中文,也不会显示中文,只会显示一堆方块。因此需要我们手动来安装中文字体。好在有一个中文字体是免费开源使用的。ssh中输入以下命令

sudo apt-get install ttf-wqy-zenhei

pi@raspberrypi:~ $ sudo apt-get install ttf-wqy-zenhei
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
fonts-wqy-zenhei
The following NEW packages will be installed:
fonts-wqy-zenhei ttf-wqy-zenhei
0 upgraded, 2 newly installed, 0 to remove and 27 not upgraded.
Need to get 7,485 kB of archives.
After this operation, 16.9 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main ttf-wqy-zenhei all 0.9.45-6 [9,226 B]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main fonts-wqy-zenhei all 0.9.45-6 [7,475 kB]
Fetched 7,485 kB in 46s (161 kB/s)
Selecting previously unselected package fonts-wqy-zenhei.
(Reading database ... 121063 files and directories currently installed.)
Preparing to unpack .../fonts-wqy-zenhei_0.9.45-6_all.deb ...
Unpacking fonts-wqy-zenhei (0.9.45-6) ...
Selecting previously unselected package ttf-wqy-zenhei.
Preparing to unpack .../ttf-wqy-zenhei_0.9.45-6_all.deb ...
Unpacking ttf-wqy-zenhei (0.9.45-6) ...
Processing triggers for fontconfig (2.11.0-6.3+deb8u1) ...
Setting up fonts-wqy-zenhei (0.9.45-6) ...
Setting up ttf-wqy-zenhei (0.9.45-6) ...
pi@raspberrypi:~ $


中文字库安装完成之后,还需要安装一个中文输入法。输入如下命令

    sudo apt-get install scim-pinyin

pi@raspberrypi:~ $ sudo apt-get install scim-pinyin
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
dialog fonts-arphic-ukai fonts-arphic-uming im-config libscim8c2a scim
scim-gtk-immodule scim-im-agent scim-modules-socket
Suggested packages:
scim-uim scim-hangul scim-chewing scim-m17n scim-prime scim-anthy scim-skk
scim-canna scim-tables-additional scim-tables-ja scim-tables-ko scim-tables-zh
scim-thai
The following NEW packages will be installed:
dialog fonts-arphic-ukai fonts-arphic-uming im-config libscim8c2a scim
scim-gtk-immodule scim-im-agent scim-modules-socket scim-pinyin
0 upgraded, 10 newly installed, 0 to remove and 0 not upgraded.
Need to get 19.4 MB of archives.
After this operation, 48.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirrordirector.raspbian.org/raspbian/ jessie/main fonts-arphic-uming all 0.2.20080216.2-7 [7,821 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian/ jessie/main libscim8c2a armhf 1.4.15-3 [226 kB]
Get:3 http://mirrordirector.raspbian.org/raspbian/ jessie/main dialog armhf 1.2-20140911-1 [233 kB]
Get:4 http://mirrordirector.raspbian.org/raspbian/ jessie/main fonts-arphic-ukai all 0.2.20080216.2-4 [8,287 kB]
Get:5 http://mirrordirector.raspbian.org/raspbian/ jessie/main im-config all 0.27-2 [53.7 kB]
Get:6 http://mirrordirector.raspbian.org/raspbian/ jessie/main scim armhf 1.4.15-3 [372 kB]
Get:7 http://mirrordirector.raspbian.org/raspbian/ jessie/main scim-modules-socket armhf 1.4.15-3 [54.0 kB]
Get:8 http://mirrordirector.raspbian.org/raspbian/ jessie/main scim-im-agent armhf 1.4.15-3 [60.9 kB]
Get:9 http://mirrordirector.raspbian.org/raspbian/ jessie/main scim-gtk-immodule armhf 1.4.15-3 [44.3 kB]
Get:10 http://mirrordirector.raspbian.org/raspbian/ jessie/main scim-pinyin armhf 0.5.92-3 [2,238 kB]
Fetched 19.4 MB in 1min 34s (206 kB/s)
Selecting previously unselected package fonts-arphic-uming.
(Reading database ... 120582 files and directories currently installed.)
Preparing to unpack .../fonts-arphic-uming_0.2.20080216.2-7_all.deb ...
Unpacking fonts-arphic-uming (0.2.20080216.2-7) ...
Selecting previously unselected package libscim8c2a:armhf.
Preparing to unpack .../libscim8c2a_1.4.15-3_armhf.deb ...
Unpacking libscim8c2a:armhf (1.4.15-3) ...
Selecting previously unselected package dialog.
Preparing to unpack .../dialog_1.2-20140911-1_armhf.deb ...
Unpacking dialog (1.2-20140911-1) ...
Selecting previously unselected package fonts-arphic-ukai.
Preparing to unpack .../fonts-arphic-ukai_0.2.20080216.2-4_all.deb ...
Unpacking fonts-arphic-ukai (0.2.20080216.2-4) ...
Selecting previously unselected package im-config.
Preparing to unpack .../im-config_0.27-2_all.deb ...
Unpacking im-config (0.27-2) ...
Selecting previously unselected package scim.
Preparing to unpack .../scim_1.4.15-3_armhf.deb ...
Unpacking scim (1.4.15-3) ...
Selecting previously unselected package scim-modules-socket:armhf.
Preparing to unpack .../scim-modules-socket_1.4.15-3_armhf.deb ...
Unpacking scim-modules-socket:armhf (1.4.15-3) ...
Selecting previously unselected package scim-im-agent.
Preparing to unpack .../scim-im-agent_1.4.15-3_armhf.deb ...
Unpacking scim-im-agent (1.4.15-3) ...
Selecting previously unselected package scim-gtk-immodule:armhf.
Preparing to unpack .../scim-gtk-immodule_1.4.15-3_armhf.deb ...
Unpacking scim-gtk-immodule:armhf (1.4.15-3) ...
Selecting previously unselected package scim-pinyin.
Preparing to unpack .../scim-pinyin_0.5.92-3_armhf.deb ...
Unpacking scim-pinyin (0.5.92-3) ...
Processing triggers for fontconfig (2.11.0-6.3+deb8u1) ...
Processing triggers for man-db (2.7.0.2-5) ...
Processing triggers for gnome-menus (3.13.3-6) ...
Processing triggers for desktop-file-utils (0.22-1) ...
Processing triggers for mime-support (3.58) ...
Processing triggers for libgtk2.0-0:armhf (2.24.25-3+deb8u1) ...
Processing triggers for libgtk-3-0:armhf (3.14.5-1+deb8u1rpi1rpi1g) ...
Setting up fonts-arphic-uming (0.2.20080216.2-7) ...
Setting up libscim8c2a:armhf (1.4.15-3) ...
Setting up dialog (1.2-20140911-1) ...
Setting up fonts-arphic-ukai (0.2.20080216.2-4) ...
Setting up im-config (0.27-2) ...
Setting up scim (1.4.15-3) ...
update-alternatives: using /etc/X11/xinit/xinput.d/scim to provide /etc/X11/xinit/xinput.d/ja_JP (xinput-ja_JP) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim to provide /etc/X11/xinit/xinput.d/ko_KR (xinput-ko_KR) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim to provide /etc/X11/xinit/xinput.d/zh_CN (xinput-zh_CN) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim to provide /etc/X11/xinit/xinput.d/zh_TW (xinput-zh_TW) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim to provide /etc/X11/xinit/xinput.d/zh_HK (xinput-zh_HK) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim to provide /etc/X11/xinit/xinput.d/zh_SG (xinput-zh_SG) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim-immodule to provide /etc/X11/xinit/xinput.d/ja_JP (xinput-ja_JP) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim-immodule to provide /etc/X11/xinit/xinput.d/ko_KR (xinput-ko_KR) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim-immodule to provide /etc/X11/xinit/xinput.d/zh_CN (xinput-zh_CN) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim-immodule to provide /etc/X11/xinit/xinput.d/zh_TW (xinput-zh_TW) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim-immodule to provide /etc/X11/xinit/xinput.d/zh_HK (xinput-zh_HK) in auto mode
update-alternatives: using /etc/X11/xinit/xinput.d/scim-immodule to provide /etc/X11/xinit/xinput.d/zh_SG (xinput-zh_SG) in auto mode
Setting up scim-modules-socket:armhf (1.4.15-3) ...
Setting up scim-im-agent (1.4.15-3) ...
Setting up scim-gtk-immodule:armhf (1.4.15-3) ...
Setting up scim-pinyin (0.5.92-3) ...
Processing triggers for libc-bin (2.19-18+deb8u6) ...
pi@raspberrypi:~ $




在输入法安装完成之后,配置一下语言
`sudo raspi-config`

![image.png](http://upload-images.jianshu.io/upload_images/831248-4ab40902f39c517b.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
然后选择change_locale
![image.png](http://upload-images.jianshu.io/upload_images/831248-0ce72b64c21066fe.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

在 Locales to be generated中选择zh_CN.UTF-8 UTF-8
![image.png](http://upload-images.jianshu.io/upload_images/831248-062372831d498730.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

在Default locale for the system environment:中选择c.UTF-8,配置完成之后,输入命令
![image.png](http://upload-images.jianshu.io/upload_images/831248-b2abcaaa1410f75e.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)


` sudo reboot`



重启完成好就可以在VNC或者远程桌面连接上去后使用中文显示和中文输入法了,切换中文输入法一样也是ctrl+space
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 214,504评论 6 496
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 91,434评论 3 389
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 160,089评论 0 349
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 57,378评论 1 288
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 66,472评论 6 386
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 50,506评论 1 292
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 39,519评论 3 413
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 38,292评论 0 270
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,738评论 1 307
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 37,022评论 2 329
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 39,194评论 1 342
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,873评论 5 338
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 40,536评论 3 322
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 31,162评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 32,413评论 1 268
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 47,075评论 2 365
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 44,080评论 2 352

推荐阅读更多精彩内容

  • PHP自定义函数设置超时间
    晓得为_阅读 436评论 0 0
  • 关于人类的思想,我首先要个别地加以研究然后再根据其序列,或其相关依存的关系加以研究,每一思想,都是我们身外物体的某...
    鹰如来阅读 648评论 0 4
  • 2017年9月30日,如是家人谭红霞,种种子第62天。 发心:我今不是为了我个人而闻思修,而是为了六道轮回一切如母...
    心雅701阅读 159评论 2 2
  • 看了一个关于爱情的故事,题目是《幸好最好的时光没有浪费在你身上》,本以为是个爱情片,谁知道竟然是个丑小鸭变白天鹅的...
    mindatan阅读 320评论 0 0
  • 时间稀缺、金钱稀缺、心态稀缺?不论什么稀缺,都会导致走入“管窥”状态,引发短视、忽视未来。 增加余闲健身释放情绪、...
    tolerancetop阅读 528评论 0 0