SFMono Square - patched font: SFMono + Migu 1M + Nerd Fonts
What's this?
SF Mono is a font from Apple, that is clear, easy to read, and suitable for programming. SFMono Square is based on SF Mono, and added glyphs for Japanese & patched for Nerd Fonts.
Now, SF Mono Square v3 has completely the same codepoints as Nerd Fonts v3's ones.
Thoughts and detail description here:
- SF Mono を使って最高のプログラミング用フォントを作った話 - Qiita (in Japanese)
font source
- SF Mono: Apple
- Migu 1M: Miguフォント : M+とIPAの合成フォント
- Nerd Fonts: ryanoasis/nerd-fonts: Iconic font aggregator, collection, and patcher. 40+ patched fonts, over 3,600 glyph/icons, includes popular collections such as Font Awesome & fonts such as Hack
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.
Troubleshooting
Install failure due to fontforge
==> Installing delphinus/sfmono-square/sfmono-square
Error: An exception occurred within a child process:
RuntimeError: /usr/local/opt/fontforge not present or broken
Please reinstall fontforge. Sorry :(
The fontforge formula does not link their binaries in default. If you see this, try again after linking it.
brew link fontforge
# again
brew install sfmono-square
VSCode shows “space” glyphs (U+0020) as double width.
See #7