3

什么字体更适合程序员?

 2 years ago
source link: https://www.techug.com/post/what-font-is-more-suitable-for-programmers.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.



img16513323071846622599.png
  • Fira Code – 带有连字的免费等宽字体

img1651332308930166474.png
  • Nerd Fonts – 修补了具有大量字形(图标)的开发人员目标字体。特别是从流行的“标志性字体”中添加大量额外的字形,例如 Font AwesomeDeviconsOcticons等。3,600 多个图标,50 多种修补字体,如 Hack、Source Code Pro 等。​

  • Operator Mono – 对编码友好的字体,Operator Mono 字体本身并不支持类似于 Fira Code 的连字,但是在社区有个工具专门针对 Operator Mono 字体做连字处理。​

制作连字的 Operator Mono 字体

第一步:下载项目

首先要有 Operator Mono 字体(网上自行搜索),然后访问下面这个项目,下载到本地。

第二步:前置环境准备

如果遇到环境安装问题,可以在评论区交流

  • Operator Mono 字体文件

  • Python (v2.7+)

  • Node.js

  • fonttools/fonttools 安装 fonttools

  • Windows/Linux: pip install fonttools

  • 注意事项: 对于 Windows,如果您的 Python 位于 C:\PythonX 下,您应该使用具有管理权限的控制台

  • 注意事项: 对于 WSL/WSL2 中的 Linux,请确保安装后将 fonttools 添加到 PATH。或者,考虑通过 sudo apt install fonttools 安装。

  • Mac: pip3 install fonttools

第三步:安装依赖及构建

  1. 压缩包解压,然后进入到文件夹下执行

    # 使用 npm 安装可能会出现 node-gyp 之类的错误,可以尝试使用 yarn 安装
    npm install
  1. 将 Operator Mono 字体文件放到 original 目录下,然后执行脚本

    # Windows
    build
    
    # Linux/Mac
    ./build.sh
  1. 生成的 Operator Mono Lig 字体在 build 文件夹下,点击安装即可

字体效果预览

我的 vscode 配置

本文文字及图片出自 InfoQ


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK