树莓派安装中文字体和中文输入法
1.更新软件源
sudo apt update && sudo apt upgrade -y
2.安装中文字体
sudo apt install fonts-wqy-zenhei fonts-wqy-microhei -y
3.设置系统语言为中文
sudo raspi-config
- 选择
Localisation Options
→Locale
sudo apt install fcitx fcitx-googlepinyin fcitx-module-cloudpinyin -y
- 使用空格键勾选
zh_CN.UTF-8 UTF-8
,Tab键切换至确认后重启 -
sudo reboot
4.安装输入法框架与引擎
sudo apt install fcitx fcitx-googlepinyin fcitx-module-cloudpinyin -y
5.配置Fcitx为默认输入法
echo "export GTK_IM_MODULE=fcitx" >> ~/.bashrc
echo "export XMODIFIERS=@im=fcitx" >> ~/.bashrc
echo "export QT_IM_MODULE=fcitx" >> ~/.bashrc
source ~/.bashrc
或通过图形界面配置:
im-config # 选择fcitx
6.重启系统应用配置
sudo reboot
7.添加输入法
fcitx-configtool
点击 +
添加 Google Pinyin
,取消勾选 Only Show Current Language
以显示中文输入法