Skip to content

Instantly share code, notes, and snippets.

@ndgnuh
Last active February 8, 2022 02:26
Show Gist options
  • Save ndgnuh/40a857478d2521541c8a6c54a018b73f to your computer and use it in GitHub Desktop.
Save ndgnuh/40a857478d2521541c8a6c54a018b73f to your computer and use it in GitHub Desktop.
Wine Chinese font
#!/bin/sh
#
# Reference https://askubuntu.com/questions/1019530/chinese-fonts-are-not-visible-in-programs-installed-in-wine
#
# Content of the .reg file just in case
#
# REGEDIT4
#
# [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink]
# "Arial"="wqy-microhei.ttc"
# "Arial Black"="wqy-microhei.ttc"
# "Arial CE,238"="wqy-microhei.ttc"
# "Arial CYR,204"="wqy-microhei.ttc"
# "Arial Greek,161"="wqy-microhei.ttc"
# "Arial TUR,162"="wqy-microhei.ttc"
# "Courier New"="wqy-microhei.ttc"
# "Courier New CE,238"="wqy-microhei.ttc"
# "Courier New CYR,204"="wqy-microhei.ttc"
# "Courier New Greek,161"="wqy-microhei.ttc"
# "Courier New TUR,162"="wqy-microhei.ttc"
# "FixedSys"="wqy-microhei.ttc"
# "Georgia"="wqy-microhei.ttc"
# "Gulim"="wqy-microhei.ttc"
# "Helv"="wqy-microhei.ttc"
# "Helvetica"="wqy-microhei.ttc"
# "Lucida Sans Unicode"="wqy-microhei.ttc"
# "Microsoft Sans Serif"="uming.ttc"
# "Microsoft Yahei"="wqy-microhei.ttc"
# "Microsoft Yahei Bold"="wqy-microhei.ttc"
# "MS Sans Serif"="wqy-microhei.ttc"
# "MS Shell Dlg"="wqy-microhei.ttc"
# "MS Shell Dlg 2"="wqy-microhei.ttc"
# "SimHei"="wqy-microhei.ttc"
# "System"="wqy-microhei.ttc"
# "Tahoma"="wqy-microhei.ttc"
# "Tahoma Bold"="wqy-microhei.ttc"
# "Times"="wqy-microhei.ttc"
# "Times New Roman CE,238"="wqy-microhei.ttc"
# "Times New Roman CYR,204"="wqy-microhei.ttc"
# "Times New Roman Greek,161"="wqy-microhei.ttc"
# "Times New Roman TUR,162"="wqy-microhei.ttc"
# "Tms Rmn"="wqy-microhei.ttc"
# "Verdana"="wqy-microhei.ttc"
# [HKEY_CURRENT_USER\Software\Wine\X11 Driver]
# "ClientSideAntiAliasWithCore"="Y"
# "ClientSideAntiAliasWithRender"="Y"
# "ClientSideWithRender"="Y"
# [HKEY_CURRENT_USER\Control Panel\Desktop]
# "FontSmoothing"="2"
# "FontSmoothingType"=dword:00000002
# "FontSmoothingGamma"=dword:00000578
# "FontSmoothingOrientation"=dword:00000001
# [HKEY_LOCAL_MACHINE\System\CurrentControlSet\Hardware Profiles\Current\Software\Fonts]
# "LogPixels"=dword:00000070
# [HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
# "MS Shell Dlg"="SimSun"
# "SimSun"="AR PL UMing CN"
# "NSimSun"="AR PL UMing CN"
# "Tms Rmn"="NSimSun"
# "仿宋"="NSimSun"
# "华文中宋"="NSimSun"
if [ -z $WINEPREFIX ]; then
WINEPREFIX=$HOME/.wine
fi
wget https://github.com/anthonyfok/fonts-wqy-microhei/raw/master/wqy-microhei.ttc -O "$WINEPREFIX/drive_c/windows/Fonts/wqy-microhei.ttc"
wget https://gist.githubusercontent.com/swordfeng/c3fd6b6fcf6dc7d7fa8a/raw/0ad845f98f5a97e7173ff40b5e57b3a163e92465/chn_fonts.reg -O /tmp/chn_fonts.reg
wine start regedit.exe /tmp/chn_fonts.reg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment