## 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](https://github.com/subframe7536/maple-font/tree/variable).









# 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](https://github.com/subframe7536/maple-font/tree/main)

## 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/`](./source/features/README.md)
- 🎨 Icon - First-Class [Nerd-Font](https://github.com/ryanoasis/nerd-fonts) 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](https://github.com/CyanoHao/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](https://github.com/subframe7536/maple-font/releases/tag/cn-base) and [this issue](https://github.com/subframe7536/maple-font/issues/211).

- No variable format support in CN version



## ScreenShots



- Pictured by [CodeImg](https://github.com/subframe7536/vscode-codeimg)
- Theme: [Maple](https://github.com/subframe7536/vscode-theme-maple)
- Config: font size 16px, line height 1.8, default letter spacing

## Download

You can download all the font archives from [Releases](https://github.com/subframe7536/maple-font/releases/tag/v7.9).

### 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(czysheep@gmail.com))

#### ArchLinuxCN (Recommended)

```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)

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



#### AUR (Not Recommended)

```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)

  ```
/* 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)

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



## CDN

### Maple Mono

- [fontsource](https://fontsource.org/fonts/maple-mono)
- [ZeoSeven Fonts](https://fonts.zeoseven.com/items/443/)

### Maple Mono CN

- [The Chinese Web Fonts Plan (中文网字计划)](https://chinese-font.netlify.app/zh-cn/fonts/maple-mono-cn/MapleMono-CN-Regular)
- [ZeoSeven Fonts](https://fonts.zeoseven.com/items/442/)

## Usage & Feature Configurations

See in [document](./source/features/README.md) or try it in [Playground](https://font.subf.dev/en/playground)

## Naming FAQ

### Features

- **Ligature**: Default version with ligatures (`Maple Mono`)
- **No-Ligature**: Default version without ligatures (`Maple Mono NL`)
- **Normal-Ligature**: [`--normal` preset](#preset) with ligatures (`Maple Mono Normal`)
- **Normal-No-Ligature**: [`--normal` preset](#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`](./config.json) file is used to configure the build process. Checkout the [schema](./source/schema.json) or [document](./source/features/README.md) for more details.

There are also some [command line options](#build-script-usage) 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](https://font.subf.dev/en/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](https://github.com/subframe7536/maple-font/actions/workflows/custom.yml) 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](https://github.com/subframe7536/maple-font/issues/131#issuecomment-3678666194)

### 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](./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:

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


[Online Preview](https://font.subf.dev/en/playground?normal)

### Freeze OpenType Feature

There are three kinds of options for feature freeze ([Why](https://github.com/subframe7536/maple-font/issues/233#issuecomment-2410170270)):

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/`](./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`](./source/features) 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](https://github.com/subframe7536/maple-font/issues/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](./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](https://github.com/subframe7536/maple-font/issues/249#issuecomment-2871260476).

And if you want to change the Latin letters' width as well, use [`--width` option](#narrow-glyph-width)

#### GitHub Mirror

The build script will auto-download required assets from GitHub. If you have trouble downloading, please set `github_mirror` in [config.json](./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](https://github.com/subframe7536/maple-font/issues/150)

### Build Script Usage

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

## Development

### Design

Using [FontLab](https://www.fontlab.com/) or [Glyphs](https://glyphs.app), 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

- [JetBrains Mono](https://github.com/JetBrains/JetBrainsMono)
- [Roboto Mono](https://github.com/googlefonts/RobotoMono)
- [Fira Code](https://github.com/tonsky/FiraCode)
- [Victor Mono](https://github.com/rubjo/victor-mono)
- [Commit Mono](https://github.com/eigilnikolajsen/commit-mono)
- [Code Sample](https://github.com/TheRenegadeCoder/sample-programs-website)
- [Nerd Font](https://github.com/ryanoasis/nerd-fonts)
- [Font Freeze](https://github.com/MuTsunTsai/fontfreeze/)
- [Font Viewer](https://tophix.com/font-tools/font-viewer)
- [Monolisa](https://www.monolisa.dev/)
- [Recursive](https://www.recursive.design/)

## Sponser

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

[](https://www.buymeacoffee.com/subframe753)

or sponsor me through [Afdian](https://afdian.com/a/subframe7536)

## Star History

<a href="https://www.star-history.com/#subframe7536/maple-font&type=date&legend=top-left">
 
   
   
   
 
</a>

## 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](https://fontforge.org/) 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](./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](https://github.com/subframe7536/maple-font/blob/chinese/source/README_CN.md)

---

## File: README_CN.md

<h1 align="center"> Maple Font </h1>







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

## 特性

参考了 [Source Code Pro](https://github.com/adobe-fonts/source-code-pro)、[Fira Code Retina](https://github.com/tonsky/FiraCode)、[Sarasa Mono SC Nerd](https://github.com/laishulu/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](https://github.com/subframe7536/Maple-font/releases/v6.4) 中下载安装，[国内地址](https://gitee.com/subframe7536/Maple/releases)|

### V7 Beta

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


## 注意事项

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

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

如果觉得字太宽，可以使用 [更纱黑体 SC Nerd](https://github.com/laishulu/Sarasa-Mono-SC-Nerd)

## 字形总览





## 屏幕截图

代码主题: [vscode-theme-maple](https://github.com/subframe7536/vscode-theme-maple)

由 [VSCodeSnap](https://github.com/luisllamasbinaburo/VSCodeSnap) 生成


**命令行（点击展开！）**








**React**








**Vue**







**Java**







**Go**







**Python**







**Rust**






## 构建

见 [文档（英文）](./source/README.md)

## Maple Mono SC NF

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



### 构建

见 [文档（中文）](https://github.com/subframe7536/maple-font/blob/chinese/source/README_CN.md)

## Maple UI

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

- Windows 使用 [noMeiryoUI](https://github.com/Tatsu-syo/noMeiryoUI) + [MacType](https://github.com/snowie2000/mactype) + [自用脚本](https://github.com/subframe7536/maple-font/tree/other-resources/cn-resource/mactype) 进行全局替换并优化渲染效果
- 网页使用 油猴/暴力猴插件 + [自用脚本](https://github.com/subframe7536/UserScript) 全局字体替换，有些不适配的可以手动添加 css
- 较上一版粗暴的减小了粗细，有可能有些字形粗细不正常或错位，欢迎提 issue
- 扩大了中文引号的宽度



### 下载地址

[Maple UI](https://github.com/subframe7536/maple-font/tree/other-resources/cn-resource/maple-ui)

## Maple Hand

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



### 下载地址

[Maple Hand](https://github.com/subframe7536/maple-font/tree/other-resources/cn-resource/maple-hand)

## 捐赠

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



## 许可证

SIL Open Font License 1.1

## 免责声明

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