Skip to content
Public template

About

Japanese terminal font based on IBM Plex Mono + M PLUS 1, with 1:2 / 3:5 and Nerd Fonts variants.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Cobalt+JPN

v1.1.0 adds first-class Nerd Font (NF) build variants.

IBM Plex Mono + M PLUS 1 を組み合わせた、日本語プログラミング向け合成フォントの single-file builder です。

ソースフォントの事前インストールは不要です。初回実行時に 各 upstream の公式 GitHub repository から取得してキャッシュします。

  • IBM Plex Mono: IBM 公式 IBM/plex, Mono 2.5.0 release commit
  • M PLUS 1: M+ 公式 coz-m/MPLUS_FONTS, full static TTF

Google Fonts 版の M PLUS 1 は使いません。Google Fonts 向けバイナリでは CJK punctuation / Halfwidth and Fullwidth Forms などの coverage が減り、Cobalt+JPN が必要とするグリフが欠落したためです。

Website / interactive specimen · Releases · Build your own · GitHub Actions · License

Variants

Family Half / Full Ratio Purpose
Cobalt+JPN 528 / 1056 1:2 通常版。端末・コード用途の本命
Cobalt+JPN 35 600 / 1000 3:5 英数字を広めに取る 35 版

Weights: Thin, ExtraLight, Light, Regular, Medium, SemiBold, Bold.

Nerd Font variants

--nerd-font を付けると、各 profile / weight に対して追加で:

  • Cobalt+JPN NF
  • Cobalt+JPN 35 NF

を生成します。Nerd Fonts Patcher は v3.5.1 に固定しています。

重要: CJK の 1:2 / 3:5 幅を壊すため --mono は使いません。代わりに Nerd Fonts の --single-width-glyphs を使い、追加アイコンだけを1セル幅に収め、既存の日本語・全角グリフの幅は変更しない方針です。既存グリフ保護のため --careful も指定します。

Glyph policy

  • Latin / ASCII / terminal-oriented symbols → IBM Plex Mono
  • Japanese / CJK → M PLUS 1
  • Hiragana, Katakana, CJK Symbols and Punctuation, CJK Unified Ideographs, Halfwidth and Fullwidth Forms, Geometric Shapes → M PLUS 1 で上書き
  • U+2016 ‖ / U+2017 ‗ → Plex に無いため M PLUS 1 から補完
  • Arrows / Box Drawing / Block Elements → Plex を維持
  • M PLUS 1 の GSUB / GPOS はマージせず、デフォルト字形を使用

Stability / source validation

FontForge の mergeFonts() 後に source glyph object が invalid になる環境があるため、1フォントごとに新しい FontForge process を起動してビルドします。1:2 と 3:5 を同じ FontForge process で連続生成しません。

また、M PLUS 1 はビルド前に coverage を検査します。Fullwidth A, U+2016 ‖, U+2017 ‗, かな、CJK など、Cobalt+JPN が依存する full-static 側の coverage が不足している場合は、壊れたフォントを焼く前に停止します。U+FF71 ア は upstream の full static M PLUS 1 自体に無いため必須条件にはしていません。

Requirements

  • FontForge with Python scripting support
  • FontForge の Python から fontTools を import できること
  • 初回のみインターネット接続

Arch Linux:

sudo pacman -S fontforge python-fonttools

Build

通常版全部(7 weights × 2 profiles = 14 fonts):

fontforge -lang=py -script cobalt_jpn.py

通常版 + NF(14 + 14 = 28 fonts):

fontforge -lang=py -script cobalt_jpn.py --nerd-font

1:2 だけ + NF:

fontforge -lang=py -script cobalt_jpn.py --profile 12 --nerd-font

1:2 だけ:

fontforge -lang=py -script cobalt_jpn.py --profile 12

35 だけ:

fontforge -lang=py -script cobalt_jpn.py --profile 35

特定ウェイト:

fontforge -lang=py -script cobalt_jpn.py --weight ExtraLight

ソース取得・coverage 検査だけ:

fontforge -lang=py -script cobalt_jpn.py --fetch-only

初回取得後のオフラインビルド:

fontforge -lang=py -script cobalt_jpn.py --offline

upstream を取り直したい場合:

fontforge -lang=py -script cobalt_jpn.py --refresh

--refresh は M PLUS 1 の master を再解決して、新しい immutable commit snapshot をキャッシュします。

Source snapshotting

IBM Plex Mono は公式 Mono 2.5.0 release commit 2f9ba1b を使用します。

M PLUS 1 は v1.0.0 では公式 repository の commit feb669c5d176b46221c1f08c55c66c8e1ba10afd に固定しています。クリーンなマシンや GitHub Actions でも同じ snapshot を使います。--refresh を明示した場合だけ master を GitHub API で最新の immutable commit SHA に解決し、その SHA を ~/.cache/cobalt-jpn/v1/MPLUS.ref に保存します。

各ビルドは dist/SOURCES.lock に source ref と SHA-256 を記録します。

Output

dist/
├── Cobalt+JPN-*-v1.1.0.otf
├── Cobalt+JPN35-*-v1.1.0.otf
├── Cobalt+JPNNF-*-v1.1.0.otf          # --nerd-font
├── Cobalt+JPN35NF-*-v1.1.0.otf        # --nerd-font
├── NOTICE.txt
├── SOURCES.lock
└── licenses/
    ├── IBM-Plex-Mono-OFL.txt
    ├── MPLUS1-OFL.txt
    ├── Nerd-Fonts-LICENSE.txt           # --nerd-font
    └── Nerd-Fonts-glyph-sources.md      # --nerd-font

GitHub Actions / Template Repository

この repository には .github/workflows/ を同梱しているため、GitHub 自体をフォント工場として使えます。

自分用 repository を作る

この repository を GitHub の Template repository に設定しておけば、利用者は:

  1. Use this template → Create a new repository
  2. 新しい repository の Actions を確認
  3. Build Cobalt+JPN workflow から生成物を Artifact として取得

という流れでローカルに FontForge を入れずにビルドできます。

build.yml は push, pull_request, workflow_dispatch に対応しています。Template から repository を作成した直後は、必要に応じて Actions → Build Cobalt+JPN → Run workflow を1回実行してください。

手動実行では profile (both, 12, 35)、weight、Nerd Font生成の有無を選べます。

Release を作る

SemVer tag を push すると release.yml が通常14本 + NF14本 = 28本をクリーンビルドし、GitHub Release を自動生成します。

git tag v1.0.0
git push origin v1.0.0

Release assets:

Cobalt+JPN-v1.0.0.zip
Cobalt+JPN-v1.0.0.tar.gz
SHA256SUMS.txt

archive には OTF 28本、SOURCES.lock, notices, font license, upstream license を含めます。

Website / interactive specimen

The Astro site lives under web/ and is kept separate from the root Python build tool. Its webfonts are prepared from the latest published GitHub Release on every font preparation/build, then the complete OTF repertoire is converted to WOFF2. The root cobalt_jpn.py remains the source/factory used to produce those Release products. No webfont binary is committed.

Local preview (each npm run fonts fetches the latest GitHub Release):

cd web
npm install
npm run fonts
npm run dev

npm run build fetches the latest Release, prepares its complete fonts, collects repository/GitHub build data, runs astro check, and creates the static site. The Pages workflow deploys automatically for web/** or Pages workflow changes pushed to main, and also supports workflow_dispatch; it passes the repository name as Astro's base path, so template-created repositories use their own project URL.

Release metadata is checked on each run, while the matching Release archive and WOFF2 conversion are reused from the ignored web/.font-cache/; the Pages workflow restores that cache with GitHub Actions cache.

npm run check only prepares site data and runs the Astro checker; it does not touch web/public/fonts. Font preparation stages all 28 WOFF2 files in a temporary directory and swaps them into place only after validation, so a failed download, extraction, or conversion preserves the currently usable webfont set.

Kitty / Fontconfig

通常版は fixed-pitch として出力します。35 版は 600:1000 のため、Fontconfig が monospace と自動判定しない場合があります。

35 を kitten choose-fonts に出す場合は、たとえば ~/.config/fontconfig/conf.d/99-cobalt-jpn35.conf:

<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd">
<fontconfig>
  <match target="scan">
    <test name="family" compare="eq">
      <string>Cobalt+JPN 35</string>
    </test>
    <edit name="spacing" mode="assign">
      <int>100</int>
    </edit>
  </match>
</fontconfig>

その後:

fc-cache -f

Licensing

  • Builder (cobalt_jpn.py): GNU GPL v3 or later (GPL-3.0-or-later) — LICENSE
  • Generated Cobalt+JPN / Cobalt+JPN NF fonts: SIL Open Font License 1.1 — FONT-LICENSE.txt
  • Upstream notices / Reserved Font Name: NOTICE.md

IBM Plex の Reserved Font Name Plex は派生 family name に使用していません。NF版は Nerd Fonts Patcher のアイコン群を追加し、dist/licenses/Nerd-Fonts-glyph-sources.md に各アイコンセットの出典・ライセンス一覧を同梱します。

Credits

  • IBM Plex Mono — IBM / IBM Plex contributors
  • M PLUS 1 — The M+ FONTS Project Authors
  • Cobalt+JPN composite adaptation — dot1245

About

Japanese terminal font based on IBM Plex Mono + M PLUS 1, with 1:2 / 3:5 and Nerd Fonts variants.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages