フォントを簡単に追加する方法はありますか?

フォントを簡単に追加する方法はありますか?

私はハードウェアエラーのために5年以上愛されているGentooインストールを失った後、FreeBSDに切り替えました。私はこれがソースコードベースのオペレーティングシステムを探索して使用する際の次の論理的なステップだと思います。読んだらFreeBSD関連ドキュメント、XOrgサーバーをインストールするとき、5.6 - XOrgセクションでフォントを使用する私の注目を集めた。私は次の行を追加したことがないことに気づきました。

Section "Files"
   FontPath  "/usr/share/fonts/...."
EndSection

これで、Gentooインストールにあるすべてのフォントに対してDEが不都合に見える理由を理解しています。障害のある片手タイピストとして、タイピングを手動で編集することがより困難になり、Files Section最後の手段として手動でフォントを追加することを好む。それでは、私がまだ見つけていない誰かが作成したツールや、ここで読者が本当にうまく作る素晴らしいシェルスクリプトなどを使ってファイルセクションに出力を追加する方法はありますかfc-list : filexorg.conf

ノートnvidia-xconfig: 以前はファイルを生成する方法を使用していたxorg.confため、今日推奨されているモジュラーアプローチとは離れています。必要に応じて、conf.dメソッドを生成された構成と混合して一致させることはできますか?

ベストアンサー1

質問を理解し、システムにvimがインストールされている場合(単にコマンドなviので動作しますex)、
端末で次のコマンドを実行すると、次のようになります。

  • ファイルを読むには:xorg.conf- 明らかに変更したいファイルに置き換えます。注:このファイルxorg.confいいえスクリプトに問題がある場合は修正してください。
  • テキスト操作をしてみてください
  • コマンドの出力はファイルに保存されます。/tmp/temp_xorg.conf

これらの操作後の状態に満足したら、/tmp/temp_xorg.conf実際に動作するxorg設定ファイルの場所にコピーできます。


コマンドの実行

xorg confファイルに入れることができる形式でフォントパスディレクトリを作成するには、シェルプロンプトでこのコマンドを実行します(このコマンドを提供した@meuhに感謝します)。

fc-list : file | sed -E 's#(.*)/.*#\tFontPath "\1"#' | sort -u > /tmp/filepaths.txt

次に、上記のコマンドの出力を取得し、ファイルセクションに挿入するこのコマンドを実行します。

$ vim -e xorg.conf << 'EOF' 
" move cursor to the line with the text: `Section "Files"`
/Section "Files"
" read in the output of `fc-list` at this point
r !fc-list
write /tmp/temp_xorg.conf
EOF

たとえば、xorg.conf次のような場合:

Section "InputClass"
    Identifier  "trackpoint catchall"
    MatchIsPointer  "true"
    MatchProduct    "TrackPoint|DualPoint Stick"
    MatchDevicePath "/dev/input/event*"
    Option  "Emulate3Buttons"   "true"
    Option  "EmulateWheel"  "true"
    Option  "EmulateWheelButton"    "2"
    Option  "XAxisMapping"  "6 7"
    Option  "YAxisMapping"  "4 5"
EndSection

Section "Files"
    Identifier  "trackpoint catchall"
    MatchIsPointer  "true"
    MatchProduct    "TrackPoint|DualPoint Stick"
    MatchDevicePath "/dev/input/event*"
    Option  "Emulate3Buttons"   "true"
    Option  "EmulateWheel"  "true"
    Option  "EmulateWheelButton"    "2"
    Option  "XAxisMapping"  "6 7"
    Option  "YAxisMapping"  "4 5"
EndSection


Section "InputClass"
    Identifier  "trackpoint catchall"
    MatchIsPointer  "true"
    MatchProduct    "TrackPoint|DualPoint Stick"
    MatchDevicePath "/dev/input/event*"
    Option  "Emulate3Buttons"   "true"
    Option  "EmulateWheel"  "true"
    Option  "EmulateWheelButton"    "2"
    Option  "XAxisMapping"  "6 7"
    Option  "YAxisMapping"  "4 5"
EndSection

上記のコマンドを実行した後、/tmp/temp_xorg.conf次のようになります。

Section "InputClass"
    Identifier  "trackpoint catchall"
    MatchIsPointer  "true"
    MatchProduct    "TrackPoint|DualPoint Stick"
    MatchDevicePath "/dev/input/event*"
    Option  "Emulate3Buttons"   "true"
    Option  "EmulateWheel"  "true"
    Option  "EmulateWheelButton"    "2"
    Option  "XAxisMapping"  "6 7"
    Option  "YAxisMapping"  "4 5"
EndSection

Section "Files"
    FontPath "/home/ubuntu/.fonts"
    FontPath "/usr/share/fonts/opentype/noto"
    FontPath "/usr/share/fonts/opentype/stix"
    FontPath "/usr/share/fonts/opentype/stix-word"
    FontPath "/usr/share/fonts/truetype"
    FontPath "/usr/share/fonts/truetype/abyssinica"
    FontPath "/usr/share/fonts/truetype/ancient-scripts"
    FontPath "/usr/share/fonts/truetype/dejavu"
    FontPath "/usr/share/fonts/truetype/fonts-guru-extra"
    FontPath "/usr/share/fonts/truetype/freefont"
    FontPath "/usr/share/fonts/truetype/kacst"
    FontPath "/usr/share/fonts/truetype/kacst-one"
    FontPath "/usr/share/fonts/truetype/lao"
    FontPath "/usr/share/fonts/truetype/lato"
    FontPath "/usr/share/fonts/truetype/liberation"
    FontPath "/usr/share/fonts/truetype/lohit-punjabi"
    FontPath "/usr/share/fonts/truetype/nanum"
    FontPath "/usr/share/fonts/truetype/openoffice"
    FontPath "/usr/share/fonts/truetype/padauk"
    FontPath "/usr/share/fonts/truetype/sinhala"
    FontPath "/usr/share/fonts/truetype/takao-gothic"
    FontPath "/usr/share/fonts/truetype/tibetan-machine"
    FontPath "/usr/share/fonts/truetype/tlwg"
    FontPath "/usr/share/fonts/truetype/ttf-khmeros-core"
    FontPath "/usr/share/fonts/truetype/ubuntu-font-family"
    FontPath "/usr/share/fonts/type1/gsfonts"
    FontPath "/usr/share/fonts/X11/Type1"
    Identifier  "trackpoint catchall"
    MatchIsPointer  "true"
    MatchProduct    "TrackPoint|DualPoint Stick"
    MatchDevicePath "/dev/input/event*"
    Option  "Emulate3Buttons"   "true"
    Option  "EmulateWheel"  "true"
    Option  "EmulateWheelButton"    "2"
    Option  "XAxisMapping"  "6 7"
    Option  "YAxisMapping"  "4 5"
EndSection


Section "InputClass"
    Identifier  "trackpoint catchall"
    MatchIsPointer  "true"
    MatchProduct    "TrackPoint|DualPoint Stick"
    MatchDevicePath "/dev/input/event*"
    Option  "Emulate3Buttons"   "true"
    Option  "EmulateWheel"  "true"
    Option  "EmulateWheelButton"    "2"
    Option  "XAxisMapping"  "6 7"
    Option  "YAxisMapping"  "4 5"
EndSection

おすすめ記事