我有这个美丽的单声道字体https://github.com/tonsky/FiraCode,我想在Ubuntu的Visual Studio Code中使用。
我下载了字体文件(.ttf),我知道要在系统范围内提供字体,必须将其复制到/usr/share/fonts
,因此我将这些文件sudo复制到了/usr/share/fonts/truetype/fira-code
复制后我发现有750的优先级,所以我将其更改为755
现在,我转到Visual Studio Code首选项,并告诉它我将使用“ Fira Code”,并且什么也不做。例如,如果我将其更改为“ DejaVu Sans Mono”,它将使用该字体。
这样做,我在LibreOffice中也看不到字体。
失败之后,我在.fonts
家里创建了一个目录并复制了.ttf文件,结果相同。(我在这里按照说明进行操作:https : //itsfoss.com/install-fonts-ubuntu-1404-1410/)
在这里复制字体,我在LibreOffice中看到它们,但是我不能在Visual Studio Code中使用它们。
因此,看起来好像有某种“字体注册表”之类的话,如何在Ubuntu中正确安装字体文件?
要设置这种漂亮的字体,请使用以下步骤
从这里下载字体
解压缩并在ttf
文件夹中双击每个文件,然后install
从出现的对话框中选择
设置VSCode:
File -> Preferences -> Settings
{}
并打开user settings
(settings.json)添加以下行:
"editor.fontFamily": "'Fira Code'",
"editor.fontLigatures": true,
font family entry
可以通过逆向过程切换回正常状态的正常状态。要更改字体粗细,请添加以下任意一行,但不是全部
"editor.fontWeight": "300" // Light
"editor.fontWeight": "400" // Regular
"editor.fontWeight": "500" // Medium
"editor.fontWeight": "600" // Bold
重新启动并享受。
我的样本用户settings.json
{
"files.autoSave": "onFocusChange",
"editor.minimap.enabled": false,
"workbench.iconTheme": "material-icon-theme",
"vsicons.projectDetection.autoReload": true,
"workbench.editor.enablePreview": false,
"workbench.editor.enablePreviewFromQuickOpen": false,
// "editor.fontFamily": "'Noto Mono', 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"breadcrumbs.enabled": true,
"typescript.updateImportsOnFileMove.enabled": "always",
"git.enableSmartCommit": true,
"java.home": "/usr/lib/jvm/java-8-oracle",
// "editor.fontLigatures": true,
"editor.fontFamily": "'Fira Code', 'Noto Mono', 'Droid Sans Mono', 'Courier New', monospace, 'Droid Sans Fallback'",
"editor.fontLigatures": true,
// "editor.fontWeight": "300", // Light
// "editor.fontWeight": "400", // Regular
// "editor.fontWeight": "500", // Medium
// "editor.fontWeight": "600" // Bold
}
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句