maple-font Documentation

Maple Mono: Open source monospace font with round corner, ligatures and Nerd-Font icons for IDE and terminal, fine-grained customization options.

RAW Doc

Docker & Self-Hosted Deployment Verified OCI

Deploy maple-font on any server, homelab, or cloud container platform.

1-Click Terminal Command
bash (docker run)
docker run -d --name maple-font --restart always subframe7536/maple-font:latest

File: README.md

[!IMPORTANT]
This branch has been frozen as a snapshot of V7. V8 will include the latest features and bug fixes. see it in variable branch.

Maple Mono

Maple Mono is an open source monospace font focused on smoothing your coding flow.

I created it to enhance my working experience, and hope that it can be useful to others.

V7 is a completely remade version, providing variable font format and source files of the font project, redesigning more than half of the glyphs, and offering smarter ligatures. You can checkout V6 here

Features

  • ✨ Variable - Infinity font weights with fine-grained italic glyphs.
  • ☁️ Smooth - Round corner, brand-new glyph of @ $ % & Q -> and cursive f i j k l x y in italic style.
  • 💪 Useful - Large amount of smart ligatures, see in features/
  • 🎨 Icon - First-Class Nerd-Font support, make your terminal more vivid.
  • 🔨 Customize - Enable or disable font features as you want, just make your own font.

Simplified Chinese, Traditional Chinese, and Japanese

CN version based on Resource Han Rounded provides complete character set support for Chinese development environments, including Simplified Chinese, Traditional Chinese, and Japanese. Meanwhile, the characteristic of perfect 2:1 alignment between Chinese and English allows this font to achieve a neat, uniform, beautiful, and comfortable appearance in scenarios such as multilingual display and Markdown tables. However, the spacing of Chinese characters is larger compared to other popular Chinese fonts. See details in release notes and this issue.

  • No variable format support in CN version

ScreenShots

  • Pictured by CodeImg
  • Theme: Maple
  • Config: font size 16px, line height 1.8, default letter spacing

Download

You can download all the font archives from Releases.

Scoop (Windows)

sh
# Add bucket
scoop bucket add nerd-fonts
# Maple Mono (ttf format)
scoop install Maple-Mono
# Maple Mono NF
scoop install Maple-Mono-NF
# Maple Mono NF CN
scoop install Maple-Mono-NF-CN

All packages (Click to expand)

sh
# Add bucket
scoop bucket add nerd-fonts
# Maple Mono (ttf format)
scoop install Maple-Mono
# Maple Mono (hinted ttf format)
scoop install Maple-Mono-autohint
# Maple Mono (otf format)
scoop install Maple-Mono-otf
# Maple Mono NF
scoop install Maple-Mono-NF
# Maple Mono NF CN
scoop install Maple-Mono-NF-CN

Homebrew (MacOS, Linux)

sh
# Maple Mono
brew install --cask font-maple-mono
# Maple Mono NF
brew install --cask font-maple-mono-nf
# Maple Mono NF CN
brew install --cask font-maple-mono-nf-cn

All packages (Click to expand)

sh
# Maple Mono
brew install --cask font-maple-mono
# Maple Mono NF
brew install --cask font-maple-mono-nf
# Maple Mono CN
brew install --cask font-maple-mono-cn
# Maple Mono NF CN
brew install --cask font-maple-mono-nf-cn

# Maple Mono Normal
brew install --cask font-maple-mono-normal
# Maple Mono Normal NF
brew install --cask font-maple-mono-normal-nf
# Maple Mono Normal CN
brew install --cask font-maple-mono-normal-cn
# Maple Mono Normal NF CN
brew install --cask font-maple-mono-normal-nf-cn

Arch Linux

ArchLinuxCN repository allows downloading a single package zip file without downloading all the package zip files in pkgbase, but AUR does not. (If you have a good solution, please contact Cyberczy([email protected]))

sh
# Maple Mono (Ligature TTF unhinted)
paru -S ttf-maplemono
# Maple Mono NF (Ligature unhinted)
paru -S ttf-maplemono-nf-unhinted
# Maple Mono NF CN (Ligature unhinted)
paru -S ttf-maplemono-nf-cn-unhinted

All packages (Click to expand)

text
/* Detailed source-code truncated for AI context efficiency. */
sh
# Maple Mono (Ligature TTF unhinted)
paru -S maplemono-ttf
# Maple Mono NF (Ligature unhinted)
paru -S maplemono-nf-unhinted
# Maple Mono NF CN (Ligature unhinted)
paru -S maplemono-nf-cn-unhinted

All packages (Click to expand)

text
/* Detailed source-code truncated for AI context efficiency. */

Nixpkgs (NixOS, Linux, MacOS)

nix
fonts.packages = with pkgs; [
  # Maple Mono (Ligature TTF unhinted)
  maple-mono.truetype
  # Maple Mono NF (Ligature unhinted)
  maple-mono.NF-unhinted
  # Maple Mono NF CN (Ligature unhinted)
  maple-mono.NF-CN-unhinted
];

All packages (Click to expand)

text
/* Detailed source-code truncated for AI context efficiency. */

CDN

Maple Mono

Maple Mono CN

Usage & Feature Configurations

See in document or try it in Playground

Naming FAQ

Features

  • Ligature: Default version with ligatures (Maple Mono)
  • No-Ligature: Default version without ligatures (Maple Mono NL)
  • Normal-Ligature: --normal preset with ligatures (Maple Mono Normal)
  • Normal-No-Ligature: --normal preset without ligatures (Maple Mono Normal NL)

Format and Glyph Set

  • Variable: Minimal version, smoothly change font weight by variable
  • TTF: Minimal version, ttf format [Recommend!]
  • OTF: Minimal version, otf format
  • WOFF2: Minimal version, woff2 format, for small size on web pages
  • NF: Nerd-Font patched version, add icons for terminal (With -NF suffix)
  • CN: Chinese version, embed with Chinese and Japanese glyphs (With -CN suffix)
  • NF-CN: Full version, embed with icons, Chinese and Japanese glyphs (With -NF-CN suffix)

Font Hint

  • Hinted font is used for low resolution screen to have a better rendering effect. From my experience, if your screen resolution is equal to or lower than 1080P, it is recommended to use "hinted font". Using an "unhinted font" will lead to misalignment or uneven thickness on your text.
    • In this case, you can choose MapleMono-TTF-AutoHint / MapleMono-NF / MapleMono-NF-CN, etc.
  • Unhinted font is used for high resolution screen (e.g., for MacBook). Using "hinted font" will blur your text or make it look weird.
    • In this case, you can choose MapleMono-OTF / MapleMono-TTF / MapleMono-NF-unhinted / MapleMono-NF-CN-unhinted, etc.
  • Why are there both -AutoHint and -unhinted suffixes?
    • for backward compatibility, I keep the original naming scheme. -AutoHint is only used for TTF format.

Custom Build

The config.json file is used to configure the build process. Checkout the schema or document for more details.

There are also some command line options for customizing the build process. CLI options have a higher priority than options in config.json.

Build Methods

1. Build In Browser

Go to Playground, and click the "Custom Build" button in the bottom left corner

  • Only supports freezing OpenType features currently.

2. Use GitHub Actions

You can use Github Actions to build the font.

  1. Fork the repo.
  2. (Optional) Change the content in config.json.
  3. Go to the Actions tab.
  4. Click on the Custom Build menu item on the left.
  5. Click on the Run workflow button with options set.
  6. Wait for the build to finish.
  7. Download the font archives from Releases.

3. Use Docker

shell
git clone https://github.com/subframe7536/maple-font --depth 1 -b variable
docker build -t maple-font .
docker run -v "$(pwd)/fonts:/app/fonts" -e BUILD_ARGS="--normal" maple-font

4. Local Build

Clone the repo and run it on your local machine. Make sure you have python3 and pip installed.

shell
git clone https://github.com/subframe7536/maple-font --depth 1 -b variable
pip install -r requirements.txt
python build.py

[!TIP]
For Ubuntu or Debian, maybe python-is-python3 is needed as well.

If you have trouble installing the dependencies, just create a new GitHub Codespace and run the commands there.

Narrow Glyph Width

You can set "width": "narrow" in config.json or add --width slim as a cli flag to change glyph width at build time.

There are 3 options:

  • default: 600
  • narrow: 550
  • slim: 500

Preview: #131

Custom Nerd-Font

If you want to get fixed-width icons, set "nerd_font.mono": true in config.json or add --nf-mono flag to build script args.

If you want to get variable-width icons, set "nerd_font.propo": true in config.json or add --nf-propo flag to build script args.

For custom font-patcher args, font-forge (and maybe python3-fontforge as well) is required.

Maybe you should also change "nerd_font.extra_args" in config.json

Default args: -l --careful --outputdir dir.

  • if "nerd_font.propo" is true, then add --variable-width-glyphs.
  • else if "nerd_font.mono" is true, then add --mono.

Preset

Run build.py with --normal flag, make the font look not so "Opinioned", just like JetBrains Mono (with slashed zero).

If you are using variable font (NOT recommended), please enable calt to make all features work.

Enabled features:

text
cv01, cv02, cv33, cv34, cv35, cv36, cv61, cv62, ss05, ss06, ss07, ss08

Online Preview

Freeze OpenType Feature

There are three kinds of options for feature freeze (Why):

  1. enable: Forcely enable the features without setting up cvXX / ssXX / zero in font features config, just as default glyphs/ligatures
  2. disable: Remove the features in cvXX / ssXX / zero, which will no longer have an effect, even if you enable them manually
  3. ignore: Do nothing

Custom OpenType Feature

OpenType Feature is used to control the font's built-in variants and ligatures. You can remove some ligatures or features you don't want to, change a feature's trigger rule, or add some new rules by modifying the OpenType Feature.

By default, the Python module in source/py/feature/ will generate a feature rule string and load it at build time. You can modify the features or customize tags there.

If you would like to modify the feature file instead, run build.py with --apply-fea-file flag, the feature file from source/features/{regular,italic}{_cn,}.fea will be loaded.

Infinite Arrow Ligatures

Inspired by Fira Code, the font enables infinite arrow ligatures by default from v7.3. For some reason, the ligatures are misaligned when using a hinted font, so they are removed in the hinted version by default from v7.4.

You can set "infinite_arrow": true in config.json or add --infinite-arrow as a cli flag to force enabling the feature. See more details in #508

Custom Font Weight Mapping

You can modify the static font weight through the "weight_mapping" item in config.json.

For example, if you want to make regular font weight a little bit lighter, just decrease the number of "weight_mapping.regular" (from 400 to 350 in this example) :

json
{
  "weight_mapping": {
    "thin": 100,
    "extralight": 200,
    "light": 300,
    "regular": 350,
    "semibold": 500,
    "medium": 600,
    "bold": 700,
    "extrabold": 800
  }
}

Chinese version

The CN version is disabled by default. Run python build.py with the --cn flag, the CN base fonts (about 111 MB) will download from GitHub.

If you want to build CN base fonts from variable (about 27 MB), set "cn.use_static_base_font": false in config.json and BE PATIENT, instantiation will take about 10-30 minutes.

Narrow spacing in CN glyphs

If you think that CN glyphs spacing is TOOOOOO large, there is a build option cn.narrow or cli flag --cn-narrow to narrow spacing in CN glyphs, but this will make the font cannot be recognized as a monospaced font. You can see the effect in #249.

And if you want to change the Latin letters' width as well, use --width option

GitHub Mirror

The build script will auto-download required assets from GitHub. If you have trouble downloading, please set github_mirror in config.json or $GITHUB to your environment variable. (Target URL will be https://<github_mirror>//<repo>/releases/download/<tag>/<file>), or just download the target .zip file and put it in the same directory as build.py.

Traditional Chinese Punctuation Support

By enabling cv99, all Chinese punctuation marks will be centred. See more details in #150

Build Script Usage

text
/* Detailed source-code truncated for AI context efficiency. */

Development

Design

Using FontLab or Glyphs, generate variable TTF into source/ folder.

Build

sh
# Init project
uv sync
# Dev
uv run build.py --ttf-only --cn --debug
# Update nerd font
uv run task.py nerd-font
# Update fea file
uv run task.py fea
# Update landing page info
uv run task.py page --sync
# Merge two fonts
uv run task.py merge
# Release
uv run task.py release minor

Credit

Sponser

If this font is helpful to you, please feel free to buy me a coffee.

or sponsor me through Afdian

Star History

License

SIL Open Font License 1.1


File: source/README.md

Build Steps

1. Clone the repo

shell
git clone https://github.com/subframe7536/Maple-font --depth 1
cd ./Maple-font/source

2. Install required Python package

shell
pip install -r requirements.txt

Install FontForge (optional)

to patch Nerd Font, please make sure FontForge and its Python module are installed

3. Modify build config (optional)

if you want to custom build the font, like freeze some font features, you can modify the config option in build.py

4. Run Build Script

shell
python build.py

if you want to patch Nerd Font version, the script will auto download Font Patcher from Github Release, or you can manully download from https://github.com/ryanoasis/nerd-fonts/releases/download/latest/FontPatcher.zip and put it to /source dir

5. Result

you can find the completed fonts and build config in /output

Build with Chinese characters

see doc


File: README_CN.md

Maple Font

正在测试[V7版本](https://github.com/subframe7536/maple-font/tree/variable),下载最新版本的可变字体:[链接](https://github.com/subframe7536/maple-font/releases)

特性

参考了 Source Code Pro、Fira Code Retina、Sarasa Mono SC Nerd 等优秀字体, 但是:

  • 🎨 新的形状 - 比如 @ # $ % & 和新的斜体样式

  • 🤙🏻 更多连字 - 比如 .., ..., /*, /**

  • 📦 更小的体积 - 只留下了基础拉丁文(英数 + 符号 + 基础的重音)、制表符

  • 🦾 更好的渲染效果 - 参考 Fira Code Retina 重新设计了字形,将宽度从原来的 600 改成了 1200,以下是在 1080p 屏幕上的对比

    v4 v5
    + 和 = 在某些字号下没有居中对齐 + 和 = 一直居中对齐
  • 🗒 更易于阅读 - 花体斜体、优化字形、降低大写字母和数字的高度、减少字体间距、居中显示 + - * = ^ ~ < >

  • 🛠️ 可配置性高 - 自由开关字体特性,成为更适合你的字体

  • ✨ 点击查看屏幕截图

安装

V6

平台/源 安装方法
macOS brew install --cask font-maple
Arch Linux AUR paru -S ttf-maple
ArchLinuxCN Repo sudo pacman -S ttf-maple
Others 从 releases 中下载安装,国内地址

V7 Beta

平台/源 安装方法
Arch Linux AUR paru -S ttf-maple-beta

注意事项

因为我没有 mac 的机子,所以目前能做的适配我都做了,但是出了问题没法测试... 所以可能需要研究研究
目前有好几个问题重启解决了... 有问题欢迎提 issue

Maple Mono NF, Maple Mono SC NF 可能没法被识别为等宽字体,我尽力了,来个大佬吧 qwq

如果觉得字太宽,可以使用 更纱黑体 SC Nerd

字形总览

屏幕截图

代码主题: vscode-theme-maple

由 VSCodeSnap 生成

命令行(点击展开!)

React

Vue

Java

Go

Python

Rust

构建

见 文档(英文)

Maple Mono SC NF

  • ✨ 合并了 Nerd Font 和 中文字体,现在只需一个字体就可以适用所有编码场景
  • ✨ 中英文 2:1
  • 在 VSCode 和 IDEA 上测试均能正常显示
  • 支持使用其他的字体生成中文部分
  • 减小中文间距并调整高度,使之看起来更协调
    • 由于美观因素,VSCode中自动换行会错位,请谅解
  • V6版本中文采用资源圆体(OFL证书)而不是V5的汉仪正圆,整个字体都可任意修改、商用
  • 需要当作阅读字体请使用 Maple UI

构建

见 文档(中文)

Maple UI

自改自用的字体,用的是 Google Sans 英数改圆角 + 汉仪正圆的汉字,侵删

  • Windows 使用 noMeiryoUI + MacType + 自用脚本 进行全局替换并优化渲染效果
  • 网页使用 油猴/暴力猴插件 + 自用脚本 全局字体替换,有些不适配的可以手动添加 css
  • 较上一版粗暴的减小了粗细,有可能有些字形粗细不正常或错位,欢迎提 issue
  • 扩大了中文引号的宽度

下载地址

Maple UI

Maple Hand

手写体,クレ pro 英数微调 + 汉仪唐美人 + 方正大签字笔体,目前用在手机端,做全局字体模块

下载地址

Maple Hand

捐赠

如果对你产生了帮助,欢迎任意金额的打赏

许可证

SIL Open Font License 1.1

免责声明

本项目中V5版本的 Maple Mono SC NF 中的汉仪正圆仅供学习与交流,本人不对使用、传播本程序及附属产物造成的任何后果承担任何责任