monaspace README

The project's README from github.com/githubnext/monaspace. As one markdown file: README.md.

Monaspace

The Monaspace type system is a monospaced type superfamily with some modern tricks up its sleeve. It consists of five variable axis typefaces. Each one has a distinct voice, but they are all metrics-compatible with one another, allowing you to mix and match them for a more expressive typographical palette.

Letters on a grid is how we see our code. Why not make those letters better?

✨ An exploration from GitHub Next. ✨ See the full story of Monaspace at monaspace.githubnext.com.

🔤 Download the latest release 🔤

image

Overview

Monaspace is five interchangable type families, each of which is packaged into three distinct formats. You can install all of them side-by-side; their family names are distinct by family and format. For example:

The variable fonts have one file per family (Neon, Argon, etc.). Modern and convenient!

The static fonts have one file per cut, per family. The variable axes have named stops for each axis, like light or bold for weight, italic for italics, and semiwide or wide for width. The combinatorial explosion of all these properties means the complete installation of static fonts involves hundreds of font files. But for situations that don't yet support variable fonts, the static builds give you a wide variety of stops throughout the range of each axis.

Texture Healing

Monaspace pioneered the technique of "texture healing" for monospaced fonts:

Texture Healing Example

Texture healing is enabled when the calt font feature setting is turned on in your editor. The location for this setting varies across applications, and not all applications support it. See the Editors section below for specific guidance.

You can read more about how it works on the Monaspace website, and learn how it is implemented in the documentation.

Nerd Fonts

As of Monaspace 1.2, the static font builds (both desktop and web) offer versions patched with Nerd Fonts!

Monaspace gives a lot of consideration to horizontal and vertical metrics of a font, and Nerd Fonts are thousands of icons which don't necessarily respect those considerations. Monaspace makes a best-effort attempt to optically align the size and placement of the icons so that they feel compatible with the other Monaspace glyphs.

There is such a broad variety of environments and terminals and often solving for one breaks another! Some Nerd Fonts glyphs may not render correctly in every environment.

[!NOTE] Monaspace uses the Nerd Fonts implementation from Cascadia Code as our starting point. Each icon was resized to fit the max advance width of the given Monaspace font, and centered vertically between the baseline and cap height of Monaspace's vertical metrics.

Coding Ligatures

[!WARNING] Ligature handling has changed significantly in Monaspace point releases. If you're upgrading, check the release notes to learn what changes you might need to make to your editor configuration:

The liga font feature enables customized spacing of repeating characters, like /// or ||. It is designed to avoid activating inside longer sequences like ////.

There are ten groups of coding ligatures, separated into stylistic sets. You may be able to enable or disable individual sets selectively:

👉 You can see an interactive display of all the ligatures on the Monaspace website

Character Variants

Specific characters have variants that you can optionally enable using the cvNN opentype feature:

cv01-cv09: figure variants

cv10-cv29: letter variants

cv30-cv59: symbol variants

cv60-cv79: optional ligatures

cv80-cv99: reserved for future use

Special Characters Galore

In addition to the ligatures, character variants, and Nerd Fonts, Monaspace includes a wealth of special characters.

Special Characters

Desktop Installation

Upgrading

Font caching on operating systems is an inscrutable mess dating back thirty years, and not something we can fix in Monaspace. Generally speaking, you should:

Restarting is usually the only way to be 100% sure that the underlying machinery in the operating system picks up the new fonts.

MacOS

You can manually drag the fonts from the fonts/otf, fonts/variable, and fonts/frozen directories into Font Book.

There is also a script that automates the deletion of all Monaspace fonts from ~/Library/Fonts and then copies over the latest versions. Invoke it from the root of the repo like:

$ bash util/install_macos.sh

You can also use Homebrew as an alternative, though it may not always have the latest version of Monaspace.

brew install --cask font-monaspace

Windows

You can manually drag the fonts from the fonts/otf, fonts/variable, and fonts/frozen directories into C:\Windows\Fonts. Alternatively, right-click the fonts you want and click Install.

Linux

You can manually drag the fonts from the fonts/otf, fonts/variable, and fonts/frozen directories into ~/.local/share/fonts.

After doing so, it's probably wise to rebuild your font cache like so:

fc-cache -f

Webfonts

All files with a .woff or .woff2 suffix are intended for use on the web. You do not install them with your operating system but add them to your web development project.

As with the desktop fonts, they are available in variable, static, and nerdfont versions.

The webfonts do not come in a "frozen" format; you can easily control Opentype features on the web using the font-feature-settings CSS property.

Editors

Visual Studio Code

[!WARNING] Ligature handling has changed significantly in Monaspace point releases. If you're upgrading, check the release notes to learn what changes you might need to make to your editor configuration:

Set the font family:

    "editor.fontFamily": "'Monaspace Neon', monospace",

Set an alternate family for inline suggestions:

    "editor.inlineSuggest.fontFamily": "'Monaspace Krypton', monospace",

[!NOTE] Variable fonts are not yet well-supported in VS Code, and it is not yet possible to mix multiple fonts. Stay tuned, we're talking with the VS Code team about it!

You must use the editor.fontLigatures setting to enable the various features (texture healing, ligatures, and character variants). The setting is a comma-separated list of font features to be enabled.

[!NOTE] This setting is unavailable from the graphical settings editor; you must create it manually.

Putting it all together, a setting string which enables everything but the character variants would look like this:

  "editor.fontLigatures": "'calt', 'liga', 'ss01', 'ss02', 'ss03', 'ss04', 'ss05', 'ss06', 'ss07', 'ss08', 'ss09'"

Specific character variants are also enabled using the font-feature-settings syntax. To enable slashed zeroes (with cv01) and six-pointed asterisks (with cv31), you might use the following settings:

  "editor.fontLigatures": "'calt', 'liga', 'ss01', 'cv01' 2, 'cv31' 1"

Note that some character variants have several possible values. For any variants that are either on or off, setting them to 1 should enable them, and omitting the variant (or setting them to 0) will disable them.

Contribution

There's no formal contribution guide yet! If you're interested in contributing to the typefaces, you should read the Texture Healing guide, as it explains how to produce the necessary alternate glyphs.

License

SIL OFL. See LICENSE.

Support

Please file issues in this repo. Monaspace is not a supported product; do not contact GitHub support with questions, as they do not support GitHub Next explorations.

Contributors

Monaspace was made to improve all code for all developers. GitHub Next set out on this journey in 2022, and we were fortunate to find a type foundry that shares our passion for improving software in Lettermatic. The result is a marriage of form and function that opens the door to new developer experiences, and that would not have been possible without the domain expertise and skill of the Lettermatic team and the time they invested in working with GitHub Next on figuring out how typography ought to work for code.

Lettermatic

lettermatic logo

GitHub Next

GitHub Next Logo

Special Thanks To

Interesting Statistics:

Star History

Star History Chart

monaspace (githubnext/monaspace)

Searching Database…

19.7K ·GitHub
这是什么东西?Monaspace 是一套包含五款等宽代码字体的超级字体系列,由 GitHub Next 携手字体工作室 Lettermatic 设计打造。这五款字体风格各不相同,但字面尺寸完全一致,因此可以在同一个编辑器里混用。
它是一款字体还是多款?为什么叫超级字体系列?它是五个可以互换的字体系列,每个都有自己独特的风格,但尺寸完全兼容,可以在一个编辑器里随意搭配混用。每个系列都提供静态版、可变字体(VF)版和 Nerd Fonts(NF)版,分别使用不同的字体名称,可以并排安装。
怎么把字体装到我的电脑上?下载最新发布版本,然后把 fonts/otf、fonts/variable 或 fonts/frozen 里的字体拖进 Font Book(macOS)、Windows 的字体文件夹,或 ~/.local/share/fonts(Linux,装完后用 fc-cache 重建字体缓存)。macOS 上仓库里还有一个更新脚本,也可以用 Homebrew 安装,不过它上面的版本可能不是最新的。
出了新版本的话,能直接覆盖安装旧版吗?最好不要——系统的字体缓存行为难以预料,所以 README 建议先删掉旧字体,再安装新字体,然后重启相关应用,可能还得重启整台电脑。另外,连字处理在小版本之间有过变动,编辑器的配置可能也需要相应更新。
这是给字体设计师用的,还是给所有写代码的人用的?是给所有写代码的人用的——README 里说 Monaspace 的目标就是为所有开发者改进所有代码的呈现。它是 GitHub Next 的一个探索项目,而非正式支持的产品,有问题请到仓库的 issues 里提,而不是找 GitHub 支持。
只能在桌面端用,还是网页上也能用?都可以——除了 macOS、Windows 和 Linux 安装包,发布版本还包含 .woff 和 .woff2 网页字体,有可变、静态和 Nerd Fonts 版本,可以添加到网页项目里。在网页上通过 font-feature-settings 这个 CSS 属性来控制字体特性,所以没有提供 frozen 版的网页构建。
Monaspace 要花钱吗?不用——它是免费的。这些字体以 SIL Open Font License 许可证发布,可以自由安装、使用和分享。
Monaspace 出名的那个 texture healing(纹理修复)特性是什么?这是 Monaspace 率先采用的一种等宽字体间距处理技术。当你的编辑器开启 calt 字体特性时它就会生效;并非所有应用都支持,完整介绍可以看 README 里指向的 Monaspace 官网和文档。
包含哪些连字和字符变体?共有十组连字,以风格集(stylistic sets)的形式提供——ss01 是等号组合,ss03 是箭头,ss05 是 F# 的管道符,ss07 是冒号——此外还有字符变体,比如带斜线的零(cv01)和可选的封闭方括号 [] 连字(cv61)。liga 特性还会调整 /// 这类重复字符的间距,同时在更长的连续符号中保持关闭。
有没有给我的终端用的、带 Nerd Fonts 图标的版本?有——从 v1.2 开始,静态桌面版和网页版构建都打上了 Nerd Fonts 补丁:包含数千个图标,这些图标本身并不遵循 Monaspace 的字面尺寸。每个图标都会尽量调整为字体的最大步进宽度并居中,但在某些环境下个别字形仍可能显示得不太正常。
Frozen 构建是干什么用的?它们是把 Monaspace 的所有排版特性(风格集)默认全部启用的 TTF 字体,专为那些无法自行配置字体特性的环境准备——README 里特别点名了 XCode 和 IntelliJ 系列的 IDE。
Creator
githubnext
Size
3.2 GB
Stars
19.7K
Age
3y
Commits · 90 Days