mmtrt / notepad-plus-plus-snap

Unofficial snap repo for notepad-plus-plus snap
https://snapcraft.io/notepad-plus-plus
MIT License
64 stars 7 forks source link

Chinese fonts not working #6

Closed brlin-tw closed 6 years ago

brlin-tw commented 6 years ago

Chinese characters in the interface are not properly rendered by default, as depicted with the following screenshot:

screenshot_20180613_235042

The default font used in the system:

$ fc-match sans
NotoSansCJK-Regular.ttc: "Noto Sans CJK TC" "Regular"
mmtrt commented 6 years ago

does font render fine on normal wine install in npp aside from this snap.

brlin-tw commented 6 years ago

Though the font selection is ugly as hell, yes:

screenshot_20180617_032431

Wine from WineHQ official deb archive, 3.0.1

mmtrt commented 6 years ago

alright can you tell me the output all of these from regedit, export them individually also paste their contents or reg files so I could implement it further into the snap thanks.

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes

HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements

also tell default font name used on npp as well.

brlin-tw commented 6 years ago

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink


HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink
    Lucida Sans Unicode    REG_MULTI_SZ    MINGLIU.TTC,PMingLiu\0SIMSUN.TTC,SimSun\0MSGOTHIC.TTC,MS UI Gothic\0BATANG.TTC,Batang
    Microsoft Sans Serif    REG_MULTI_SZ    MINGLIU.TTC,PMingLiu\0SIMSUN.TTC,SimSun\0MSGOTHIC.TTC,MS UI Gothic\0BATANG.TTC,Batang
    Tahoma    REG_MULTI_SZ    MINGLIU.TTC,PMingLiu\0SIMSUN.TTC,SimSun\0MSGOTHIC.TTC,MS UI Gothic\0BATANG.TTC,Batang

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes


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

HKEY_CURRENT_USER\Software\Wine\Fonts\Replacements

reg: The system was unable to find the specified registry key or value

NOTE:

also tell default font name used on npp as well.

It seems to be using PMingLiU, but it really should use Noto Sans CJK/Droid Sans Fallback.

mmtrt commented 6 years ago

@Lin-Buo-Ren thanks and I've working local npp snap with that noto cjk sc font that looks way better then PMingLiU so I'm implementing a check for detecting locale then use cjk font if user locale is on zh_* and I might implement command flag to change fonts to cjk

can you tell output of locale inside of npp snap shell of locale.

then run

PS: do tell locale output of your system as well.

brlin-tw commented 6 years ago

In snap:

$ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=zh_TW.UTF-8
LANGUAGE=zh_TW:zh_CN
LC_CTYPE="zh_TW.UTF-8"
LC_NUMERIC="zh_TW.UTF-8"
LC_TIME="zh_TW.UTF-8"
LC_COLLATE="zh_TW.UTF-8"
LC_MONETARY="zh_TW.UTF-8"
LC_MESSAGES="zh_TW.UTF-8"
LC_PAPER="zh_TW.UTF-8"
LC_NAME="zh_TW.UTF-8"
LC_ADDRESS="zh_TW.UTF-8"
LC_TELEPHONE="zh_TW.UTF-8"
LC_MEASUREMENT="zh_TW.UTF-8"
LC_IDENTIFICATION="zh_TW.UTF-8"
LC_ALL=

Host:

LANG=zh_TW.UTF-8
LANGUAGE=zh_TW:zh_CN
LC_CTYPE="zh_TW.UTF-8"
LC_NUMERIC="zh_TW.UTF-8"
LC_TIME="zh_TW.UTF-8"
LC_COLLATE="zh_TW.UTF-8"
LC_MONETARY="zh_TW.UTF-8"
LC_MESSAGES="zh_TW.UTF-8"
LC_PAPER="zh_TW.UTF-8"
LC_NAME="zh_TW.UTF-8"
LC_ADDRESS="zh_TW.UTF-8"
LC_TELEPHONE="zh_TW.UTF-8"
LC_MEASUREMENT="zh_TW.UTF-8"
LC_IDENTIFICATION="zh_TW.UTF-8"
LC_ALL=
mmtrt commented 6 years ago

Test 7.5.6 (62) on edge, gui font should be now Noto Sans CJK TC Regular though you have to manually set npp font to Noto Sans CJK TC Regular for text.

Make sure remove .wine folder from ~/snap/notepad-plus-plus/common/ before test.

brlin-tw commented 6 years ago

screenshot_20180617_183825

The UI font change seems to be effective however the application locale are forced to English, it's switchable in setting UI though, just not default.

brlin-tw commented 6 years ago

screenshot_20180617_184050

Yep it works properly now, thanks!