Skip to content

Instantly share code, notes, and snippets.

@tsukumijima
Last active March 5, 2021 17:01
Show Gist options
  • Save tsukumijima/24f9dd2e35ed792b063e65fea6d89ea9 to your computer and use it in GitHub Desktop.
Save tsukumijima/24f9dd2e35ed792b063e65fea6d89ea9 to your computer and use it in GitHub Desktop.
VSCode (Windows) の UI フォントを変更するツール(設定を環境に合わせて変更してください)
@echo off
python %~dp0\VSCodeUIFontChanger.py
# *****   設定   *****
# 変更するフォント名
font = 'Meiryo'
# VSCode のパス
vscode_path = r'C:\Applications\Microsoft VS Code'
# ***** 設定ここまで *****
# 置換対象のファイルのパス
replace_files = [
vscode_path + r'\resources\app\out\vs\workbench\workbench.desktop.main.css',
vscode_path + r'\resources\app\out\vs\workbench\workbench.desktop.main.js',
vscode_path + r'\resources\app\out\vs\code\electron-sandbox\processExplorer\processExplorerMain.css',
vscode_path + r'\resources\app\out\vs\code\electron-sandbox\issue\issueReporterMain.css',
]
for replace_file in replace_files:
# ファイルを開く
with open(replace_file, mode = 'r', encoding = 'utf-8') as file:
replace = file.read()
# 文字列置換
replace = replace.replace('Yu Gothic UI', font)
# ファイルに書き込み
with open(replace_file, mode = 'w', encoding = 'utf-8') as file:
file.write(replace)
print('Replaced ' + replace_file)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment