How to use custom font in visual studio code

前端 未结 3 1261
时光取名叫无心
时光取名叫无心 2020-12-09 08:58

This isn\'t so much a coding question as it is about the visual studio code editor. What I want to do is use source code pro in the editor, but I don\'t know what to change

3条回答
  •  渐次进展
    2020-12-09 09:19

    This is tested in VSCode 1.30.2 in Windows:

    1. Ensure the font is available. In Windows, ttf fonts can be installed via right click font file -> Install (requires elevation).
    2. Ctrl+, => Settings => type font-family
    3. Choose User Settings and Workspace Settings
    4. Go to Text Editor => Font Family => Change value (font family names with a blank might require single quotes). Example:

      'Fira Code', Consolas, 'Courier New', monospace
      
    5. Enable font ligatures (if needed)

    6. A VSCode restart might be required in order to see the new font applied

    Note: after step 1, you can also press Open Settings (top-right corner) to edit directly the json settings. Example:

    {
        "editor.fontFamily": "'Fira Code', Consolas, 'Courier New', monospace",
        "editor.fontLigatures": true
    }
    

提交回复
热议问题