让wine程序使用所有字体

需要一个打过中文字体补丁的wine
安装好wine以后,将以下内容保存为FontConfigs.reg(以ASCII编码保存),打开终端输入wine regedit,导入这个注册表文件(似乎每次安装wine都必须重新导入一次)
代碼:
REGEDIT4

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink]
"FontLinkControl"=dword:00004000
"FontLinkDefaultChar"=dword:00003000

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
"Lucida Sans Unicode"=hex(7):4d,53,47,4f,54,48,49,43,2e,54,54,43,00,4d,53,20,55,\
49,20,47,6f,74,68,69,63,00,00
"Microsoft Sans Serif"=hex(7):53,69,6d,53,75,6e,2e,54,54,43,00,53,69,6d,53,75,6e,\
00,00
"SimSun"=hex(7):67,75,6c,69,6d,2e,74,74,63,00,67,75,6c,69,6d,00,00
"Tahoma"=hex(7):53,69,6d,53,75,6e,2e,54,54,43,00,53,69,6d,53,75,6e,00,00

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontMapper]
"@宋体"=dword:00002086
"@新宋体"=dword:0000a086
"ARIAL"=dword:00000000
"COURIER"=dword:00008800
"COURIER NEW"=dword:00008000
"DEFAULT"=dword:00000086
"FIXEDSYS"=dword:00009000
"MS SANS SERIF"=dword:00001000
"MS SERIF"=dword:00005000
"SMALL FONTS"=dword:00000800
"SYMBOL"=dword:00004002
"SYMBOL1"=dword:0000a002
"TIMES NEW ROMAN"=dword:00004000
"WINGDINGS"=dword:00000002
"WINGDINGS2"=dword:00008002
"宋体"=dword:00000086
"新宋体"=dword:00008086

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"Arial Baltic,186"="Arial,186"
"Arial CE,238"="Arial,238"
"Arial CYR,204"="Arial,204"
"Arial Greek,161"="Arial,161"
"Arial TUR,162"="Arial,162"
"Courier New Baltic,186"="Courier New,186"
"Courier New CE,238"="Courier New,238"
"Courier New CYR,204"="Courier New,204"
"Courier New Greek,161"="Courier New,161"
"Courier New TUR,162"="Courier New,162"
"Helv"="MS Sans Serif"
"Helvetica"="Arial"
"MS Shell Dlg"="Microsoft Sans Serif"
"MS Shell Dlg 2"="Tahoma"
"Times"="Times New Roman"
"Times New Roman Baltic,186"="Times New Roman,186"
"Times New Roman CE,238"="Times New Roman,238"
"Times New Roman CYR,204"="Times New Roman,204"
"Times New Roman Greek,161"="Times New Roman,161"
"Times New Roman TUR,162"="Times New Roman,162"
"Tms Rmn"="MS Serif"

[HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\GRE_Initialize]
"DisableRemoteFontBootCache"=dword:00000000
"FIXEDFON.FON"="svgafix.fon"
"FONTS.FON"="svgasys.fon"
"GUIFont.CharSet"=dword:00000086
"GUIFont.Facename"="宋体"
"GUIFont.Height"=dword:00000009
"OEMFONT.FON"="vga936.fon"

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
前面还参考了这篇文章

wine 中文乱码的解决方法

可惜这个方法只解决了wine的中文目录对话框中文不乱码,对程序内部的文字乱码没有作用。

新装的wine中文全是乱码,需要修改一下几个配置文件,找到一篇比较详细的配置说明,分享一下:
“ wine下中文的配置方案
步骤:
1. 初始设置
运行 winecfg,把模拟的 Windows 系统设置为 Windows XP 或者 Windows 2000。
2. 准备字体
为了让 Windows 应用程序看上去更美观,所以需要 Windows 下面的字体。
由于我已经将 simsun.ttc 复制到 /usr/share/fonts/windows/ 目录中了。所以我只需要在 ~/.wine/drive_c/windows/fonts/ 目录中为 simsun.ttc 创建一个符号连接:
cd ~/.wine/drive_c/windows/fonts
ln -s /usr/share/fonts/windows/simsun.ttc simsun.ttc
ln -s /usr/share/fonts/windows/simsun.ttc simfang.ttc
创建一个 simfang.ttc 是许多 Windows 应用默认使用 simfang.ttc 字体。
3. 修改 ~/.wine/system.reg
装好字体后,还要修改一下 Wine 的注册表设置,指定与字体相关的设置:
gedit ~/.wine/system.reg
(一定要使用 gedit 或其他支持 gb2312/utf8 编码的编辑器修改这些文件,否则文件中的中文可能变乱码)
搜索: LogPixels
找到的行应该是:[System\\CurrentControlSet\\Hardware Profiles\\Current\\Software\\Fonts]
将其中的:
"LogPixels"=dword:00000060
改为:
"LogPixels"=dword:00000070
搜索: FontSubstitutes
找到的行应该是:[Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes]
将其中的:
"MS Shell Dlg"="Tahoma"
"MS Shell Dlg 2″="Tahoma"
改为:
"MS Shell Dlg"="SimSun"
"MS Shell Dlg 2″="SimSun"
4. 修改 ~/.wine/drive_c/windows/win.ini
gedit ~/.wine/drive_c/windows/win.ini
在文件末尾加入:
[Desktop]
menufontsize=13
messagefontsize=13
statusfontsize=13
IconTitleSize=13
   5. 最关键的一步,网上很多文章中没有提到的一步──把下面的代码保存为zh.reg,然后终端执行regedit zh.reg。从Windows目录下的Fonts里的simsun.ttc复制到/home/user/.wine/drive_c/windows/fonts里面。
      代码:
      REGEDIT4
      [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
      "Arial"="simsun"
      "Arial CE,238"="simsun"
      "Arial CYR,204"="simsun"
      "Arial Greek,161"="simsun"
      "Arial TUR,162"="simsun"
      "Courier New"="simsun"
      "Courier New CE,238"="simsun"
      "Courier New CYR,204"="simsun"
      "Courier New Greek,161"="simsun"
      "Courier New TUR,162"="simsun"
      "FixedSys"="simsun"
      "Helv"="simsun"
      "Helvetica"="simsun"
      "MS Sans Serif"="simsun"
      "MS Shell Dlg"="simsun"
      "MS Shell Dlg 2"="simsun"
      "System"="simsun"
      "Tahoma"="simsun"
      "Times"="simsun"
      "Times New Roman CE,238"="simsun"
      "Times New Roman CYR,204"="simsun"
      "Times New Roman Greek,161"="simsun"
      "Times New Roman TUR,162"="simsun"
      "Tms Rmn"="simsun"
之后,中文正常显示哈哈!如图:


这样wine的字体问题就解决了,所有程序都能和在Windows里一样显示它的字体
。目前我自己测试还没有发现什么问题,中文字都能正常显示。欢迎大家多提意见!
reg文件一定要用notpad编辑保存,我还把windows下面的所有字体都复制到wine下。
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值