在 CentOS 上使用 PhpStorm 设置字体,通常有两种情况:
一是 IDE 界面字体,二是 代码编辑器字体。下面分别说明(适用于 PhpStorm 2020+,老版本路径略有差异)。
File → Settings(或按 Ctrl + Alt + S)
Editor → Font
JetBrains Mono、Consolas、Microsoft YaHei(中文)✅ 这是写代码时看到的字体
File → Settings → Appearance & Behavior → Appearance
Use custom font
Dialog、Noto Sans CJK SC)⚠️ 如果 CentOS 中文显示乱码,建议安装中文字体:
sudo yum install -y google-noto-sans-cjk-fonts
sudo yum groupinstall "Fonts" -y
sudo yum install -y wqy-zenhei-fonts
./phpstorm.sh
Q:改了字体没生效?
Editor → Font 还是 AppearanceQ:CentOS 下字体太少?
.ttf 字体到:~/.fonts
然后执行:fc-cache -fv
如果你用的是 特定 CentOS 版本(7 / 8 / Stream) 或 PhpStorm 具体版本,可以告诉我,我可以给你更精确的步骤。