一条命令,将OSX的UI中文字体改为冬青体

首先,为什么要换字体呢?先上一张流传已久的图看一看:

OSX 默认的 STHeitiSC/TC 确实不太靠谱,在系统自带的字体中,Hiragino Sans GB(亦称冬青体)是效果最好的中文替代字体。在终端中使用以下命令即可替换默认字体为冬青体:

1
sudo sed -ie 's/STHeitiTC-Light/Hiragino Sans GB/g;s/STHeitiSC-Light/Hiragino Sans GB/g' /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/DefaultFontFallbacks.plist

然后打开磁盘工具修复磁盘权限后重启系统即可发现改变。如果需要恢复原始配置,请执行:

1
2
sudo rm /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/DefaultFontFallbacks.plist
sudo mv /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/DefaultFontFallbacks.pliste /System/Library/Frameworks/ApplicationServices.framework/Frameworks/CoreText.framework/Resources/DefaultFontFallbacks.plist

然后修复权限并重启系统即可。(曾出现个例无法自动备份文件到 *.pliste,请自行承担风险)

(Original post by me is HERE)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.