Skip to content

Commit

Permalink
Update Emoji and Icons
Browse files Browse the repository at this point in the history
* Use Noto Emoji (monochrome) instead of Twitter Color Emoji SVGinOT
* Use Nerd icons because fixed issue: ryanoasis/nerd-fonts#365

Signed-off-by: Youhei SASAKI <uwabami@gfd-dennou.org>
  • Loading branch information
uwabami committed Aug 23, 2023
1 parent 3863ede commit 29e6d9a
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 103 deletions.
50 changes: 23 additions & 27 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
SRCD = sourceFonts
DIST = dists
TMPD = tmp
NERD = FontPatcher
VERSION = $(shell date '+%Y%m%d%H%M%S')
all: build

Expand All @@ -10,21 +11,21 @@ build: download
@PYTHONPATH=$(CURDIR)/scripts \
python3 -c "import sys;import build; sys.exit(build.build('$(VERSION)'))"

download: dl_rmgen dl_fsm dl_twemoji dl_icons
download: dl_rmgen dl_fsm dl_notoemoji dl_nerdfontsymbolonly

dl_rmgen:
@[ -d $(SRCD) ] || mkdir -p $(SRCD)
@[ -d $(SRCD) ] || mkdir -p $(SRCD)
@if [ ! -f $(SRCD)/rounded-x-mgenplus-1mn-regular.ttf ] ; then\
echo "Download Rounded Mgen+" ;\
wget https://osdn.jp/downloads/users/8/8599/rounded-x-mgenplus-20150602.7z ;\
wget https://ftp.iij.ad.jp/pub/osdn.jp/users/8/8599/rounded-x-mgenplus-20150602.7z ;\
unar rounded-x-mgenplus-20150602.7z ;\
cp -v rounded-x-mgenplus-20150602/rounded-x-mgenplus-1mn*.ttf $(SRCD)/ ;\
rm -fr rounded-x-mgenplus-20150602 ;\
rm -f rounded-x-mgenplus-20150602.7z ;\
fi

dl_fsm:
@[ -d $(SRCD) ] || mkdir -p $(SRCD)
@[ -d $(SRCD) ] || mkdir -p $(SRCD)
@if [ ! -f $(SRCD)/FantasqueSansMono-Regular.ttf ] ; then\
echo "Download Fantasque Sans Mono" ;\
wget https://fontlibrary.org/assets/downloads/fantasque-sans-mono/b0cbb25e73a9f8354e96d89524f613e7/fantasque-sans-mono.zip ;\
Expand All @@ -34,31 +35,26 @@ dl_fsm:
rm -f fantasque-sans-mono.zip ;\
fi

dl_twemoji:
@[ -d $(SRCD) ] || mkdir -p $(SRCD)
@if [ ! -f $(SRCD)/TwitterColorEmoji-SVGinOT-ThickFallback.ttf ] ; then\
echo "Download Twitter Color Emoji SVG in OpenType" ;\
wget https://github.com/eosrei/twemoji-color-font/releases/download/v13.0.1/TwitterColorEmoji-SVGinOT-ThickFallback-13.0.1.zip ;\
unar TwitterColorEmoji-SVGinOT-ThickFallback-13.0.1.zip ;\
cp -v TwitterColorEmoji-SVGinOT-ThickFallback-13.0.1/*.ttf $(SRCD)/ ;\
rm -fr TwitterColorEmoji-SVGinOT-ThickFallback-13.0.1 ;\
rm -f TwitterColorEmoji-SVGinOT-ThickFallback-13.0.1.zip ;\
dl_notoemoji:
@[ -d $(SRCD) ] || mkdir -p $(SRCD)
@if [ ! -f $(SRCD)/NotoEmoji-Regular.ttf ] ; then\
echo "Download Noto Emoji Monchrome" ;\
wget "https://fonts.google.com/download?family=Noto%20Emoji" -O Emoji.zip;\
unar Emoji.zip ;\
cp -v Emoji/static/NotoEmoji-Regular.ttf $(SRCD)/ ;\
rm -fr Emoji ;\
rm -f Emoji.zip ;\
fi

dl_symbola:
@[ -d $(SRCD) ] || mkdir -p $(SRCD)
@if [ ! -f $(SRCD)/Symbola.otf ] ; then\
echo "Download Symbola: Multilingual support and Symbol blocks of The Unicode Standard" ;\
wget https://dn-works.com/wp-content/uploads/2020/UFAS-Fonts/Symbola.zip ;\
unar Symbola.zip ;\
cp -v Symbola/Symbola.otf $(SRCD)/ ;\
rm -fr Symbola ;\
rm -f Symbola.zip ;\
fi

dl_icons:
@if [ ! -f $(SRCD)/isfit-plus.ttf ] ; then\
wget https://github.com/uwabami/isfit-plus/raw/master/dists/isfit-plus.ttf -O $(SRCD)/isfit-plus.ttf ;\
dl_nerdfontsymbolonly:
@[ -d $(SRCD) ] || mkdir -p $(SRCD)
@if [ ! -f $(SRCD)/SymbolsNerdFont-Regular.ttf ] ; then\
echo "Download NerdFontSymbolOnly" ;\
wget https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/NerdFontsSymbolsOnly.zip ;\
unar NerdFontsSymbolsOnly.zip ;\
cp -v NerdFontsSymbolsOnly/SymbolsNerdFont-Regular.ttf $(SRCD)/ ;\
rm -fr NerdFontsSymbolsOnly ;\
rm -f NerdFontsSymbolsOnly.zip ;\
fi

clean:
Expand Down
34 changes: 15 additions & 19 deletions README.org
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,19 @@
* FSMRMP - Patched Font: 'Fantasque Sans Mono' + 'Rounded Mgen+'
** Overview

[[https://fontlibrary.org/en/font/fantasque-sans-mono][Fantasque Sans Mono]] is a monospace font with a distinct slightly
cursive look. The fonts "FSMRMP" (*wanted! awesome fontname*) is based on
*Fantasque Sans Mono*, and add glpyhs for Japanese from [[http://jikasei.me/font/rounded-mgenplus/][Rounded Mgen plus]],
and patched icon fonts into Private Use Area.
The fonts "FSMRMP" is a font that combines [[https://fontlibrary.org/en/font/fantasque-sans-mono][Fantasque Sans Mono]], [[http://jikasei.me/font/rounded-mgenplus/][Rounded Mgen plus]], [[https://fonts.google.com/noto/specimen/Noto+Emoji][Noto Emoji]] (Monochrome) and [[https://github.com/ryanoasis/nerd-fonts][Nerd fonts]] icons.

** Build
*** Requirements
- make
- python3:
- python3-concurrent: for parallel builds
- python3-fontforge
- unar: expand donwload files
*** Ubuntu 19.04, Debian (>= 10.0)
- wget: download sources.
- unar: expand donwload files.
*** Ubuntu 20.04, Debian (>= 12.0)
#+begin_src shell
sudo apt install make wget unar python3 python3-concurrent.futures python3-fontforge
make
% sudo apt install make wget unar python3 python3-fontforge
% make
#+end_src
check =dists= directory.
** Font sources
Expand All @@ -26,17 +23,16 @@ make
only be used to represent the company or product to which they refer.

Base fonts:
|---------------------+----------+--------------|
| Name | Version | License |
|---------------------+----------+--------------|
| [[https://fontlibrary.org/en/font/fantasque-sans-mono#Fantasque%2520Sans%2520Mono-Regular][Fantasque Sans Mono]] | 11 | [[https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL][SIL OFL v1.1]] |
| [[http://jikasei.me/font/rounded-mgenplus/][Rounded Mgen plus]] | 20150602 | [[https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL][SIL OFL v1.1]] |
| [[https://github.com/eosrei/twemoji-color-font][twemoji color font]] | v12.0.1 | [[https://github.com/eosrei/twemoji-color-font/blob/master/LICENSE-CC-BY.txt][CC BY-4.0]] |
|---------------------+----------+--------------|

Icon fontset: @see [[https://github.com/uwabami/isfit-plus][isfit+]]
|-------------------------+----------+--------------|
| Name | Version | License |
|-------------------------+----------+--------------|
| [[https://fontlibrary.org/en/font/fantasque-sans-mono#Fantasque%2520Sans%2520Mono-Regular][Fantasque Sans Mono]] | 1.8.0 | [[https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL][SIL OFL v1.1]] |
| [[http://jikasei.me/font/rounded-mgenplus/][Rounded Mgen plus]] | 20150602 | [[https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL][SIL OFL v1.1]] |
| [[https://fonts.google.com/noto/specimen/Noto+Emoji][Noto Emoji]] | v15.0.0 | [[https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL][SIL OFL v1.1]] |
| [[https://github.com/ryanoasis/nerd-fonts/tree/master/patched-fonts/NerdFontsSymbolsOnly][Nerd Fonts Symbols Only]] | v3.0.2 | [[https://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL][SIL OFL v1.1]] |
|-------------------------+----------+--------------|

** References.

Original build scripts provided by [[https://github.com/delphinus/homebrew-sfmono-square][SFMono Square - patched font: SFMono + Migu 1M + Nerd Fonts]].
Original build scripts inspired by [[https://github.com/delphinus/homebrew-sfmono-square][SFMono Square - patched font: SFMono + Migu 1M + Nerd Fonts]].
Thanks to great scripts!
47 changes: 24 additions & 23 deletions scripts/build.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#! /usr/bin/python
#! /usr/bin/python3
import sys
from concurrent.futures import ProcessPoolExecutor, as_completed
import rounded_x_mgenplus
Expand All @@ -7,6 +7,7 @@
import emoji
import font_patcher


RMGEN = [
["sourceFonts/rounded-x-mgenplus-1mn-regular.ttf"],
["sourceFonts/rounded-x-mgenplus-1mn-bold.ttf"]
Expand All @@ -18,21 +19,21 @@
["sourceFonts/FantasqueSansMono-BoldItalic.ttf"],
]
EMOJI = [
["sourceFonts/TwitterColorEmoji-SVGinOT-ThickFallback.ttf"]
["sourceFonts/NotoEmoji-Regular.ttf"]
]
FSM_RMGEN = [
["tmp/modified-FantasqueSansMono-Regular.ttf",
"tmp/modified-rounded-x-mgenplus-1mn-regular.ttf",
"tmp/modified-TwitterColorEmoji-SVGinOT-ThickFallback.ttf"],
"tmp/modified-NotoEmoji-Regular.ttf"],
["tmp/modified-FantasqueSansMono-Bold.ttf",
"tmp/modified-rounded-x-mgenplus-1mn-bold.ttf",
"tmp/modified-TwitterColorEmoji-SVGinOT-ThickFallback.ttf"],
"tmp/modified-NotoEmoji-Regular.ttf"],
["tmp/modified-FantasqueSansMono-Italic.ttf",
"tmp/modified-rounded-x-mgenplus-1mn-oblique.ttf",
"tmp/modified-TwitterColorEmoji-SVGinOT-ThickFallback.ttf"],
"tmp/modified-NotoEmoji-Regular.ttf"],
["tmp/modified-FantasqueSansMono-BoldItalic.ttf",
"tmp/modified-rounded-x-mgenplus-1mn-bold-oblique.ttf",
"tmp/modified-TwitterColorEmoji-SVGinOT-ThickFallback.ttf"],
"tmp/modified-NotoEmoji-Regular.ttf"],
]
FSM_RMGEN_PLUS = [
["tmp/FSMRMP-Regular.ttf", "dists"],
Expand All @@ -42,23 +43,23 @@
]

def build(version):
print("---- modifying rounded-x-mgenplus ----")
if concurrent_execute(rounded_x_mgenplus.modify, RMGEN):
return 1
print("---- modifying fantasque_sans_mono ----")
if concurrent_execute(fantasque_sans_mono.modify, FSM):
return 1
print("---- making oblique version of rounded-x-mgenplus ----")
if concurrent_execute(rounded_x_mgenplus.oblique, RMGEN):
return 1
print("---- modifying Twitter Color Emoji ----")
if concurrent_execute(emoji.modify, EMOJI):
return 1
print("---- generate Fantasque Sans Mono Rounded Mgen+ ----")
args = [a + [version] for a in FSM_RMGEN]
if concurrent_execute(fsmrmp.generate, args):
return 1
print("---- adding Icons ----")
# print("---- modifying rounded-x-mgenplus ----")
# if concurrent_execute(rounded_x_mgenplus.modify, RMGEN):
# return 1
# print("---- modifying fantasque_sans_mono ----")
# if concurrent_execute(fantasque_sans_mono.modify, FSM):
# return 1
# print("---- making oblique version of rounded-x-mgenplus ----")
# if concurrent_execute(rounded_x_mgenplus.oblique, RMGEN):
# return 1
# print("---- modifying Noto Emoji ----")
# if concurrent_execute(emoji.modify, EMOJI):
# return 1
# print("---- generate Fantasque Sans Mono Rounded Mgen+ ----")
# args = [a + [version] for a in FSM_RMGEN]
# if concurrent_execute(fsmrmp.generate, args):
# return 1
print("---- adding Nerd Icons ----")
if concurrent_execute(font_patcher.patch, FSM_RMGEN_PLUS):
return 1
return 0
Expand Down
14 changes: 7 additions & 7 deletions scripts/emoji.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
# -*- coding:utf-8 -*-
## Twitter Color Emoji or Symbola
## NotoEmoji monochrome

from os.path import basename, splitext
import fontforge
import psMat

ASCENT = 1650
DESCENT = 398
ASCENT = 1638
DESCENT = 410
OLD_EM = 2048
EM = ASCENT + DESCENT
SCALE_DOWN = 0.98
X_TO_CENTER = EM * (1 - SCALE_DOWN) / 2
SCALE_DOWN = 0.9
X_TO_CENTER = - EM * (1 - SCALE_DOWN) / 2
# OBLIQUE_SKEW = 0.2

def modify(in_file):
Expand Down Expand Up @@ -39,8 +39,8 @@ def _set_new_em(font):
"""
font.selection.all()
font.unlinkReferences()
font.ascent = float(ASCENT) / EM * OLD_EM
font.descent = float(DESCENT) / EM * OLD_EM
font.ascent = round(float(ASCENT) / EM * OLD_EM)
font.descent = round(float(DESCENT) / EM * OLD_EM)
font.em = EM

def _set_proportion(font):
Expand Down
16 changes: 11 additions & 5 deletions scripts/fantasque_sans_mono.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# -*- coding:utf-8 -*-
## Fantasque Sans Mono
# Ascent: 1650
# Descent: 398
# Ascent: 1638
# Descent: 410
# Width: 1060
# EM: 2048

from os.path import basename, splitext
import fontforge
import psMat
from psMat import scale

OLD_WIDTH = 1060
WIDTH = 1024
Expand All @@ -25,8 +25,14 @@ def modify(in_file):


def _set_proportion(font):
mat = psMat.scale(SCALE_DOWN)
mat = scale(SCALE_DOWN)
font.selection.all()
scaled = set()
for glyph in list(font.selection.byGlyphs):
glyph.transform(mat)
codepoint = glyph.unicode
if codepoint != -1 and codepoint in scaled:
print(f"this is already scaled: {codepoint:#x}")
else:
glyph.transform(mat)
scaled.add(codepoint)
glyph.width = WIDTH
Loading

0 comments on commit 29e6d9a

Please sign in to comment.