[英]How do i setup font ligatures for Visual Studio Code?
我正在使用這兩行為我的 VSCode 設置字體連字。
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
但它看起來仍然和以前一樣。
我試圖禁用所有已安裝的擴展程序,但沒有奏效。
這是我的完整設置:
{
"workbench.iconTheme": "material-icon-theme",
"workbench.colorTheme": "Material Theme Darker High Contrast",
"editor.formatOnSave": true,
"explorer.confirmDelete": false,
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"window.zoomLevel": 0,
"editor.fontSize": 16, //!=
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
"explorer.confirmDragAndDrop": false
}
我想要功能齊全的字體連字,如本頁所示:我希望它看起來如何。 相反,我得到了一些字體的基本文本。
第 1 步:安裝Fira 代碼。
第 2 步:在 VSCode 設置中設置字體:
"editor.fontFamily": "Fira Code, Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": true,
第 3 步:重新啟動/重新加載 VSCode。
就是這樣。
您的 PC 中似乎沒有安裝 Fira 字體。 如果您使用的是 MacOS,請按照此步驟操作。
打開終端並運行這些命令。
brew tap homebrew/cask-fonts
brew cask install font-fira-code
並嘗試重新啟動 VsCode。
或者,如果您使用的是其他操作系統(Windows 或 Linux),請按照此步驟操作。 https://github.com/tonsky/FiraCode/wiki/Installing
希望這可能會有所幫助。
從 VS Code 1.40 開始, editor.fontLigatrues
支持字符串設置,這對於支持不同風格集的字體很有用:
IE:
"editor.fontLigatures": "'ss09', 'zero', 'onum'",
"editor.fontLigatures": "'ss01'",
您可以在此處閱讀有關功能標簽的更多信息(但支持取決於相關字體):
https://docs.microsoft.com/en-us/typography/opentype/spec/featuretags
如果您使用的是 macOS,有時您需要重新啟動計算機才能使 Visual Studio Code 的連字生效。
我解決了我的問題,把 Fira 代碼放在沒有“”的地方
對於使用不同版本 VS Code 的用戶,您可以嘗試按 control 和逗號的組合鍵( Ctrl + , )打開設置選項卡,然后在搜索字體連字后
在此之后單擊settings.json 中的編輯。
然后設置editor.fontLigatures=true
。
完成此步驟后,您就可以開始了。
為 Mac“計算機”而不是“用戶”安裝 FiraCode 字體系列
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.