Rictyのバッククォートが被るのを修正しようとしたら少し嵌った話

4 min read読了の目安(約3900字

VSCode × Ricty Diminished を使っています

全角半角とか可視化出来ていいんだけど、1 点問題がありました

バッククォートが後ろの文字に被ってしまうことです

markdown とか書いていると非常に困ります...

hoge を"`"で囲むとこうなります

VSCode 側の問題かと思って調べたら Ricty 側の問題(?)らしいです

https://qiita.com/uKLEina/items/ff0877871fc425952b92#comment-74375ba083e256f6c787

ということで修正してみます

まずは fontforge を install します

$ brew install fontforge

依存 package が多いので、インストールに大分時間かかり CPU も喰うので余裕あるときにやるのをオススメしますw

Open($1)
Select(0u0060)
SetGlyphClass("base")
Generate($1)

これをscript として保存する

$ chmod 755 script
$ find ~/Library/Fonts/\*.ttf | xargs -I {} fontforge -lang ff -script script {}
dyld: Library not loaded: @rpath/libfontforge.4.dylib
  Referenced from: /Users/some/path/bin/fontforge
  Reason: image not found

とエラーになった... ぐぬぬ

brew update/upgrade したり fontforge 及び依存 package のアップデートしたり色々試したけど解決しませんでした

docker を使う

mac の実行環境が駄目っぽいので docker × centos7 で実行してみました

$ docker run -v ~/Library/Fonts:/root/fonts -v ~/tmp/fix-font/script:/root/script -it centos:7

フォントと script ファイルを docker に mount して実行しました。

script ファイルは上で書いてある script です

# fontforgeのインストール
[root@5a84cd1fad47 /]# yum install -y fontforge
# fontの変換
[root@5a84cd1fad47 /]# find /root/fonts/*.ttf  | xargs -I {} fontforge -lang ff -script /root/script {}
Copyright (c) 2000-2012 by George Williams.
 Executable based on sources from 14:57 GMT 31-Jul-2012.
 Library based on sources from 14:57 GMT 31-Jul-2012.
This font contains both a 'mor[tx]' table and a 'GSUB' table.
  FF will only read feature/settings in 'morx' which do not match features
  found in 'GSUB'.
Copyright (c) 2000-2012 by George Williams.
 Executable based on sources from 14:57 GMT 31-Jul-2012.
 Library based on sources from 14:57 GMT 31-Jul-2012.
This font contains both a 'mor[tx]' table and a 'GSUB' table.
  FF will only read feature/settings in 'morx' which do not match features
  found in 'GSUB'.
Copyright (c) 2000-2012 by George Williams.
 Executable based on sources from 14:57 GMT 31-Jul-2012.
 Library based on sources from 14:57 GMT 31-Jul-2012.
This font contains both a 'mor[tx]' table and a 'GSUB' table.
  FF will only read feature/settings in 'morx' which do not match features
  found in 'GSUB'.
Copyright (c) 2000-2012 by George Williams.
 Executable based on sources from 14:57 GMT 31-Jul-2012.
 Library based on sources from 14:57 GMT 31-Jul-2012.
This font contains both a 'mor[tx]' table and a 'GSUB' table.
  FF will only read feature/settings in 'morx' which do not match features
  found in 'GSUB'.
Copyright (c) 2000-2012 by George Williams.
 Executable based on sources from 14:57 GMT 31-Jul-2012.
 Library based on sources from 14:57 GMT 31-Jul-2012.
This font contains both a 'mor[tx]' table and a 'GSUB' table.
  FF will only read feature/settings in 'morx' which do not match features
  found in 'GSUB'.
Copyright (c) 2000-2012 by George Williams.
 Executable based on sources from 14:57 GMT 31-Jul-2012.
 Library based on sources from 14:57 GMT 31-Jul-2012.
This font contains both a 'mor[tx]' table and a 'GSUB' table.
  FF will only read feature/settings in 'morx' which do not match features
  found in 'GSUB'.
Copyright (c) 2000-2012 by George Williams.
 Executable based on sources from 14:57 GMT 31-Jul-2012.
 Library based on sources from 14:57 GMT 31-Jul-2012.
This font contains both a 'mor[tx]' table and a 'GSUB' table.
  FF will only read feature/settings in 'morx' which do not match features
  found in 'GSUB'.
Copyright (c) 2000-2012 by George Williams.
 Executable based on sources from 14:57 GMT 31-Jul-2012.
 Library based on sources from 14:57 GMT 31-Jul-2012.
This font contains both a 'mor[tx]' table and a 'GSUB' table.
  FF will only read feature/settings in 'morx' which do not match features
  found in 'GSUB'.

拍子抜けするほど、あっさり実行できてしまった... 🎉

きれいにバッククォートも表示されるようになった!! めでたしめでたし!!