wine/crossover字型問題

levinit發表於2018-12-06

幾種解決linux中wine/crossover字型問題的方法。

字型連結

Windows支援字型連結:當一種字型中不存在某個字時,可以嘗試從另一個字型檔案中尋找相應的字形。

透過登入檔指定代替的字型以達到wine程式使用linux已經安裝的字型的目錄。

  1. 編寫登入檔檔案,假如該檔案為fonts.reg。
  2. 啟動wine的regedit登入檔程式,點選登入檔-匯入登入檔檔案,選擇fonts.reg檔案匯入。

    crossover中開啟“執行命令“,執行regedit(或者選中容器後在右鍵選單中選擇“執行命令“)即可開啟登入檔程式。

如果仍有部分字型出現方塊,嘗試在wine配置(winecfg程式)中將系統改為其他版本(如xp)。


fonts.reg檔案示例——使用SourceHanSansCN-Medium.otf代替windows字型。
下載reg檔案

如要使用其他字型自行更換為具體字型檔名(例如文泉驛微米黑wqy-microhei.ttc),提示:在/usr/share/fonts下可找到該字型檔案。

REGEDIT4

 [HKEY_LOCAL_MACHINESoftwareMicrosoftWindows NTCurrentVersionFontLinkSystemLink]
 "System"="SourceHanSansCN-Medium.otf"
 "Sans Serif"="SourceHanSansCN-Medium.otf"
 "Arial"="SourceHanSansCN-Medium.otf"
 "Arial Black"="SourceHanSansCN-Medium.otf"
 "Arial CE,238"="SourceHanSansCN-Medium.otf"
 "Arial CYR,204"="SourceHanSansCN-Medium.otf"
 "Arial Greek,161"="SourceHanSansCN-Medium.otf"
 "Arial TUR,162"="SourceHanSansCN-Medium.otf"
 "Microsoft Sans Serif"="SourceHanSansCN-Medium.otf"
 "Microsoft YaHei"="SourceHanSansCN-Medium.otf"
 "微軟雅黑"="SourceHanSansCN-Medium.otf"
 "MS Sans Serif"="SourceHanSansCN-Medium.otf"
 "MS Shell Dlg"="SourceHanSansCN-Medium.otf"
 "MS Shell Dlg 2"="SourceHanSansCN-Medium.otf"
 "Tahoma"="SourceHanSansCN-Medium.otf"
 "Tahoma Bold"="SourceHanSansCN-Medium.otf"
 "SimSun"="SourceHanSansCN-Medium.otf"
 "SimHei"="SourceHanSansCN-Medium.otf"
 "SimKai"="SourceHanSansCN-Medium.otf"
 "SimFang"="SourceHanSansCN-Medium.otf"
 "宋體"="SourceHanSansCN-Medium.otf"
 "新細明體"="SourceHanSansCN-Medium.otf"
 "MingLiU"="SourceHanSansCN-Medium.otf"
 "PMingLiU"="SourceHanSansCN-Medium.otf"
 "DFKai-SB"="SourceHanSansCN-Medium.otf"
 "FangSong"="SourceHanSansCN-Medium.otf" "KaiTi"="SourceHanSansCN-Medium.otf"
 "Microsoft JhengHei"="SourceHanSansCN-Medium.otf"
 "NSimSun"="SourceHanSansCN-Medium.otf"
 "Lucida Sans Unicode"="SourceHanSansCN-Medium.otf"
 "Courier New"="SourceHanSansCN-Medium.otf"
 "Courier New CE,238"="SourceHanSansCN-Medium.otf"
 "Courier New CYR,204"="SourceHanSansCN-Medium.otf"
 "Courier New Greek,161"="SourceHanSansCN-Medium.otf"
 "Courier New TUR,162"="SourceHanSansCN-Medium.otf"
 "FixedSys"="SourceHanSansCN-Medium.otf"
 "Helv"="SourceHanSansCN-Medium.otf"
 "Helvetica"="SourceHanSansCN-Medium.otf"
 "Times"="SourceHanSansCN-Medium.otf"
 "Times New Roman CE,238"="SourceHanSansCN-Medium.otf"
 "Times New Roman CYR,204"="SourceHanSansCN-Medium.otf"
 "Times New Roman Greek,161"="SourceHanSansCN-Medium.otf"
 "Times New Roman TUR,162"="SourceHanSansCN-Medium.otf"
 "Tms Rmn"="SourceHanSansCN-Medium.otf"

微調字型渲染的登入檔檔案adjust-fonts.reg(同樣按上面的方法匯入登入檔即可):

REGEDIT4 [HKEY_CURRENT_USERSoftwareWineX11 Driver] "ClientSideAntiAliasWithCore"="Y" "ClientSideAntiAliasWithRender"="Y" "ClientSideWithRender"="Y" [HKEY_CURRENT_USERControl PanelDesktop] "FontSmoothing"="2" "FontSmoothingType"=dword:00000002 "FontSmoothingGamma"=dword:00000578 "FontSmoothingOrientation"=dword:00000001

使用Windows字型

硬碟中存在一個windows系統

掛載windows的C:盤,例如其被掛載在/windows

ln -s /windows/Windows/Fonts /usr/share/fonts/WindowsFonts

然後重新生成字型快取:

fc-cache

或者,將Windows的字型複製到/usr/share/fonts:

mkdir /usr/share/fonts/WindowsFonts
cp /windows/Windows/Fonts/* /usr/share/fonts/WindowsFonts
chmod 755 /usr/share/fonts/WindowsFonts/*

然後重新生成字型快取:

fc-cache

提供相應的windows字型

把相關字型(如simsun.ttc)放到~/.wine/drive_c/windows/Fonts/目錄。

相關文章