{"id":937,"date":"2025-01-25T11:25:39","date_gmt":"2025-01-25T03:25:39","guid":{"rendered":"https:\/\/me.spacelite.top\/?p=937"},"modified":"2025-01-25T11:25:39","modified_gmt":"2025-01-25T03:25:39","slug":"%e4%bf%ae%e5%a4%8dwin11%e4%b8%adword%e5%ad%97%e4%bd%93%e4%b8%8e%e6%97%a7%e5%ad%97%e4%bd%93%e5%90%8d%e7%a7%b0%e4%b8%8d%e5%90%8c%e5%af%bc%e8%87%b4%e7%9a%84%e6%98%be%e7%a4%ba%e5%bc%82%e5%b8%b8%ef%bc%88po","status":"publish","type":"post","link":"https:\/\/me.spacelite.top\/?p=937","title":{"rendered":"\u4fee\u590dwin11\u4e2dword\u5b57\u4f53\u4e0e\u65e7\u5b57\u4f53\u540d\u79f0\u4e0d\u540c\u5bfc\u81f4\u7684\u663e\u793a\u5f02\u5e38\uff08Powershell\u811a\u672c\uff09"},"content":{"rendered":"<p>\u6253\u5f00\u7ba1\u7406\u5458\u7ec8\u7aef\uff0c\u8fd0\u884c\u4ee5\u4e0b\u811a\u672c\uff1a<\/p>\n<p><code># \u5fc5\u987b\u7528\u7ba1\u7406\u5458\u6743\u9650\u8fd0\u884c<\/code><br \/>\n<code>if (-not ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) {<\/code><br \/>\n<code>Start-Process powershell.exe \"-NoProfile -ExecutionPolicy Bypass -File `\"$PSCommandPath`\"\" -Verb RunAs<\/code><br \/>\n<code>exit<\/code><br \/>\n<code>}<\/code><\/p>\n<p><code># \u8bbe\u7f6e\u6267\u884c\u7b56\u7565\uff08\u4ec5\u9996\u6b21\u8fd0\u884c\u9700\u8981\uff09<\/code><br \/>\n<code>Set-ExecutionPolicy RemoteSigned -Scope Process -Force<\/code><\/p>\n<p><code># \u5b9a\u4e49\u5168\u91cf\u65e7\u2192\u65b0\u5b57\u4f53\u6620\u5c04\u8868\uff08\u8986\u76d6GB2312\u3001GBK\u3001XP\u65f6\u4ee3\u65e7\u540d\u79f0\uff09<\/code><br \/>\n<code>$fontMappings = @{<\/code><br \/>\n<code># \u4e2d\u6587\u65e7\u5b57\u4f53<\/code><br \/>\n<code>\"\u6977\u4f53_GB2312\" = \"KaiTi\" # \u65e7\u6977\u4f53 \u2192 \u65b0\u6977\u4f53<\/code><br \/>\n<code>\"\u4eff\u5b8b_GB2312\" = \"FangSong\" # \u65e7\u4eff\u5b8b \u2192 \u65b0\u4eff\u5b8b<\/code><br \/>\n<code>\"\u5b8b\u4f53\" = \"SimSun\" # \u65e7\u5b8b\u4f53 \u2192 \u65b0\u5b8b\u4f53<\/code><br \/>\n<code>\"\u9ed1\u4f53_GB2312\" = \"SimHei\" # \u65e7\u9ed1\u4f53 \u2192 \u65b0\u9ed1\u4f53<\/code><br \/>\n<code>\"\u65b9\u6b63\u5c0f\u6807\u5b8b_GBK\" = \"FZXiaoBiaoSong-B05\" # \u7279\u6b8a\u516c\u6587\u5b57\u4f53<\/code><br \/>\n<code>\"\u534e\u6587\u6977\u4f53\" = \"KaiTi\" # \u7b2c\u4e09\u65b9\u5b57\u4f53\u517c\u5bb9<\/code><\/p>\n<p><code># \u82f1\u6587\u65e7\u5b57\u4f53\u6620\u5c04<\/code><br \/>\n<code>\"Arial Narrow\" = \"Arial\"<\/code><br \/>\n<code>\"Times New Roman Baltic\" = \"Times New Roman\"<\/code><\/p>\n<p><code># \u7cfb\u7edf\u9057\u7559\u5b57\u4f53<\/code><br \/>\n<code>\"MS UI Gothic\" = \"Yu Gothic UI\" # \u65e5\u8bed\u5b57\u4f53\u66f4\u65b0<\/code><br \/>\n<code>\"MS Mincho\" = \"Yu Mincho\"<\/code><\/p>\n<p><code># \u6269\u5c55\u4fee\u590d\uff08\u6765\u81ea\u7528\u6237\u5e38\u89c1\u95ee\u9898\uff09<\/code><br \/>\n<code>\"\u5e7c\u5706\" = \"YouYuan\" # \u65e7\u7248\u5e7c\u5706\u5b57\u4f53<\/code><br \/>\n<code>\"\u96b6\u4e66\" = \"LiSu\"<\/code><br \/>\n<code>\"\u534e\u6587\u65b0\u9b4f\" = \"STXinwei\"<\/code><br \/>\n<code>}<\/code><\/p>\n<p><code># \u6ce8\u518c\u8868\u8def\u5f84<\/code><br \/>\n<code>$regPath = \"HKLM:\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes\"<\/code><\/p>\n<p><code># \u6279\u91cf\u4fee\u590d\uff08\u5e26\u8fdb\u5ea6\u663e\u793a\uff09<\/code><br \/>\n<code>Write-Host \"\u6b63\u5728\u626b\u63cf\u5e76\u4fee\u590d\u65e7\u5b57\u4f53\u6620\u5c04...\" -ForegroundColor Cyan<\/code><br \/>\n<code>$total = $fontMappings.Count<\/code><br \/>\n<code>$current = 0<\/code><\/p>\n<p><code>foreach ($key in $fontMappings.Keys) {<\/code><br \/>\n<code>$current++<\/code><br \/>\n<code>$percent = [math]::Round(($current\/$total)*100)<\/code><br \/>\n<code>$value = $fontMappings[$key]<\/code><\/p>\n<p><code># \u5199\u5165\u6ce8\u518c\u8868<\/code><br \/>\n<code>try {<\/code><br \/>\n<code>Set-ItemProperty -Path $regPath -Name $key -Value $value -ErrorAction Stop -Force<\/code><br \/>\n<code>Write-Host \"[$percent%] \u5df2\u4fee\u590d: $key \u2192 $value\" -ForegroundColor Green<\/code><br \/>\n<code>}<\/code><br \/>\n<code>catch {<\/code><br \/>\n<code>Write-Host \"[!] \u4fee\u590d\u5931\u8d25: $key (\u53ef\u80fd\u6743\u9650\u4e0d\u8db3\u6216\u952e\u503c\u88ab\u9501\u5b9a)\" -ForegroundColor Red<\/code><br \/>\n<code>}<\/code><br \/>\n<code>}<\/code><\/p>\n<p><code># \u5b8c\u6210\u63d0\u793a<\/code><br \/>\n<code>Write-Host \"`n\u5df2\u5b8c\u6210\u6240\u6709\u65e7\u5b57\u4f53\u6620\u5c04\u4fee\u590d\uff01\" -ForegroundColor Yellow<\/code><br \/>\n<code>Write-Host \"\u5f3a\u70c8\u5efa\u8bae\u91cd\u542f\u7535\u8111\u4f7f\u66f4\u6539\u751f\u6548\uff08\u672a\u91cd\u542f\u524dWord\u53ef\u80fd\u4ecd\u4f7f\u7528\u7f13\u5b58\uff09`n\" -ForegroundColor Magenta<\/code><\/p>\n<p><code># \u53ef\u9009\uff1a\u4e00\u952e\u6253\u5f00\u6ce8\u518c\u8868\u8def\u5f84\u4f9b\u9a8c\u8bc1<\/code><br \/>\n<code>$choice = Read-Host \"\u662f\u5426\u8981\u7acb\u5373\u6253\u5f00\u6ce8\u518c\u8868\u9a8c\u8bc1\u4fee\u6539\uff1f(Y\/N)\"<\/code><br \/>\n<code>if ($choice -eq \"Y\") {<\/code><br \/>\n<code>regedit.exe \/m \/v \"HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes\"<\/code><br \/>\n<code>}<\/code><\/p>\n<p><code>Read-Host \"\u6309\u56de\u8f66\u952e\u9000\u51fa\"<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6253\u5f00\u7ba1\u7406\u5458\u7ec8\u7aef\uff0c\u8fd0\u884c\u4ee5\u4e0b\u811a\u672c\uff1a # \u5fc5\u987b\u7528\u7ba1\u7406\u5458\u6743\u9650\u8fd0\u884c if (-not ([Security.P&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-937","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/posts\/937","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=937"}],"version-history":[{"count":1,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/posts\/937\/revisions"}],"predecessor-version":[{"id":938,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=\/wp\/v2\/posts\/937\/revisions\/938"}],"wp:attachment":[{"href":"https:\/\/me.spacelite.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=937"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=937"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/me.spacelite.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=937"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}