LoginSignup
2
3

More than 5 years have passed since last update.

Macでfc-listコマンドでフォントがなにも表示されないとき

Last updated at Posted at 2015-05-23

背景

GTK+ Download: Mac OS Xを参考に
jhbuildでGimpをビルドした。

問題 

2台のマックで作業をしたのだが、片方がGtkのフォント選択ダイアログでなにもフォントが
表示されない状態。

なかなかこの原因がわからなかった。

解決への糸口の発見

~/gtk/inst/bin/fc-list

の結果がフォント一覧が出てる場合、ずらずら/usr/X11R6/lib配下のフォントが表示される。

わかったこと

2台共、Xquartzは入れてはいたが、
/usr/X11R6
が問題となったMacの方には無かった。どうやら、これがないと、

~/gtk/inst/etc/fonts/fonts.conf 

<!-- Font directory list -->

    <dir>/usr/share/fonts</dir>
    <dir>/usr/X11R6/lib/X11/fonts</dir>
    <dir prefix="xdg">fonts</dir>
    <!-- the following element will be removed in the future -->
    <dir>~/.fonts</dir>

といった具合に、/usr/X11R6のエントリが書き込まれない。

/usr/share/fontsは存在しないが、これはデフォルトで書かれるのかも。。

解決方法

ln -s /opt/X11 /usr/X11R6

して、初めからjhbuildをやり直すか、

~/gtk/inst/etc/fonts/fonts.conf

に、

<!-- Font directory list -->

    <dir>/usr/share/fonts</dir>
    <dir>/opt/X11/lib/X11/fonts</dir>
    <dir prefix="xdg">fonts</dir>
    <!-- the following element will be removed in the future -->
    <dir>~/.fonts</dir>

<dir>/opt/X11/lib/X11/fonts</dir>

のエントリを追記することで対応できる。

これで、gimpでフォントを加工するプラグインが「フォントがないので文字機能の利用はできません」とならずに、利用可能になった。

2015/5/24 追記

Xquartzを入れずとも、

<!-- Font directory list -->

        <dir>/usr/share/fonts</dir>
        <dir>~/Library/Fonts</dir>
        <dir>/Library/Fonts</dir>
        <dir>/System/Library/Fonts</dir>
        <dir prefix="xdg">fonts</dir>
        <!-- the following element will be removed in the future -->
        <dir>~/.fonts</dir>

と、OSXの標準的なフォントが格納されているフォルダを指定することで、対応できる模様。

2
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
3