Skip to content
Projets

delphinus/homebrew-sfmono-square

Voir sur GitHub

À propos

SF Mono Square - patched font: SF Mono + Migu 1M + Nerd Fonts

Design et médias

Comment ces chiffres sont mesurés

Progression mesurée des étoiles

in 24h
0
in 7 days
0
in 15 days
0
in 1 month
Historique en cours

Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.

README.md

Original

SF Mono Square - patched font: SF Mono + Migu 1M + Nerd Fonts

SF Mono Square: a terminal with Japanese, Latin letters and Nerd Fonts icons on a grid of cells, in which a Japanese letter takes two cells

What's this?

SF Mono is a font from Apple, that is clear, easy to read, and suitable for programming. SF Mono Square is based on SF Mono, and added glyphs for Japanese & patched for Nerd Fonts. SF Mono Square is for macOS only.

Thoughts and detail description here:

Weights

SF Mono Square comes in the 6 weights SF Mono has — Light, Regular, Medium, Semibold, Bold and Heavy — each with its italic. Migu 1M has only Regular and Bold, so the Japanese glyphs of the other weights are made from them: Light, Medium and Semibold by thinning or thickening the strokes of Regular, and Heavy uses those of Bold as they are.

Regular, Bold and their italics make the family "SF Mono Square". The other weights join it in the typographic family (name IDs 16 & 17); apps that do not read them list such a weight as a family of its own, such as "SF Mono Square Light".

SF Mono Square in Light, Regular, Medium, Semibold, Bold and Heavy, upright and italic

Kanji beyond JIS X 0213

Migu 1M has the kanji of JIS X 0213 only, about 9,600 of the 21,000 CJK Unified Ideographs. The others in the BMP — the rest of CJK Unified Ideographs, Extension A, CJK Compatibility Ideographs, the radicals and the strokes — are taken from Source Han Sans, scaled to the size of Migu 1M and merged into SF Mono Square. Each weight is filled with the weight of Source Han Sans of the closest ink density: Normal for Light, Regular for Regular, Medium for Medium and Semibold, and Bold for Bold and Heavy.

Glyphs of SF Mono Square coloured by the font each comes from: SF Mono, Migu 1M, Source Han Sans and Plangothic, on a grid of cells

Extension B and later (more than 70,000 ideographs) do not fit in a font with the rest, as a font holds 65,535 glyphs at most. They are made from Plangothic into 2 fonts of their own, "SF Mono Square Ext P1" and "SF Mono Square Ext P2", with the same metrics as SF Mono Square. Map the codepoints to them in your terminal, such as symbol_map in kitty:

symbol_map U+20000-U+2A6DF,U+2A700-U+2EE5F,U+2F800-U+2FA1F SF Mono Square Ext P1
symbol_map U+30000-U+3347F SF Mono Square Ext P2

font source

And, idea and some code is from プログラミング用フォント Ricty.

How to use

Install with Homebrew.

brew tap delphinus/sfmono-square
brew install sfmono-square

open "$(brew --prefix sfmono-square)/share/fonts"
# open fonts with Finder

Customize

Change the ratio the size for zenkaku / hankaku

In default, this formula reduces the size of glyphs in Migu 1M (zenkaku font) and matches with SF Mono (hankaku font). The ratio is 82%.

When you want to change this value, you can do this by brew edit and follow comments in the formula.

brew edit sfmono-square

See screenshots for examples here.

Known issues

Powerline separators out of the row by a pixel

A terminal that draws the Powerline separators (U+E0B0 and the others) from the font can show a pixel of them above or below their row, as it rounds the baseline to a pixel. This cannot be fixed in the font. Let the terminal draw them by itself: kitty and Ghostty always do, WezTerm does by default (custom_block_glyphs = true), and iTerm2 does with "Use built-in Powerline glyphs" in Settings → Profiles → Text. Terminal.app has no such option. See the details.

Release

  1. Write the release notes in .github/release-notes/vX.Y.Z.md. The first line is the title of the release, and the rest is its body.
  2. Merge them into master.
  3. Run bin/release X.Y.Z.

bin/release only checks the tree (on master, clean, up to date with origin, notes written, build check green) and pushes the tag vX.Y.Z. Everything else is done by the release workflow: it creates the release from the notes and commits the formula that points at the new tag (url / version / sha256) into master.

Nothing is released unless the fonts are built from the very commit the tag points at. The workflow waits for the build check of the commit to start and to finish, and stops when it is not successful or when it never appears. This is checked on the workflow, so tagging without bin/release cannot skip it.

When the push to master did not start the build check (for example, [skip ci] was in the message of the merged commit), start it by hand with gh workflow run build.yml --ref master, and run bin/release after it succeeds.

Gallery

Neovim, with the file explorer of snacks.nvim and lualine.nvim:

Neovim editing a Lua file with Japanese comments, with a file tree and a status line with icons

eza with --icons:

eza listing a tree of files with icons, some of them named in Japanese

A table of SQLite with -box:

sqlite3 drawing a table with Japanese headers and values in box-drawing characters

tig:

tig showing a history of commits with Japanese messages and a graph of branches

The Japanese help of Vim from vimdoc-ja:

The Japanese help of eval() in Neovim

btop:

btop drawing graphs of CPU and memory with braille patterns

Explorer des projets similaires

Chargement…