-
Notifications
You must be signed in to change notification settings - Fork 2
/
Correct-FontOfCjkCharactersInShellDialog.ps1
40 lines (40 loc) · 1.53 KB
/
Correct-FontOfCjkCharactersInShellDialog.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
Set-ItemProperty `
-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\GRE_Initialize" `
-Name "GUIFont.Facename" `
-Value "Microsoft JhengHei UI" `
-Force
Set-ItemProperty `
-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" `
-Name "MS Sans Serif" `
-Value "Microsoft Sans Serif" `
-Force
$NewLinksOfShellDialogFontToPrepand = @(
"MSJH.TTC,Microsoft Jhenghei UI,128,96"
"MSJH.TTC,Microsoft Jhenghei UI"
"MSYH.TTC,Microsoft YaHei UI,128,96"
"MSYH.TTC,Microsoft YaHei UI"
"MEIRYO.TTC,Meiryo UI,128,96"
"MEIRYO.TTC,Meiryo UI"
"SIMHEI.TTF,SimHei"
"MSGOTHIC.TTC, MS UI Gothic"
"MALGUN.TTF,Malgun Gothic,128,96"
"MALGUN.TTF,Malgun Gothic"
"YUGOTHM.TTC,Yu Gothic UI,128,96"
"YUGOTHM.TTC,Yu Gothic UI"
)
@("MS Shell Dlg", "MS Shell Dlg 2") | ForEach-Object {
$ShellDialogFont = Get-ItemPropertyValue `
-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontSubstitutes" `
-Name $_
$LinksOfShellDialogFont = Get-ItemPropertyValue `
-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink" `
-Name $ShellDialogFont
$LinksOfShellDialogFont = $NewLinksOfShellDialogFontToPrepand + (
$LinksOfShellDialogFont | Where-Object { $_ -notin $NewLinksOfShellDialogFontToPrepand }
)
Set-ItemProperty `
-Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontLink\SystemLink" `
-Name $ShellDialogFont `
-Value $LinksOfShellDialogFont `
-Force
}