コンテンツにスキップ

「フォントパッケージガイドライン」の版間の差分

提供: ArchWiki
削除された内容 追加された内容
Kgx (トーク | 投稿記録)
英語版から転載
 
Kgx (トーク | 投稿記録)
他言語へのリンクを追加
 
(同じ利用者による、間の6版が非表示)
1行目: 1行目:
[[Category:Arch パッケージガイドライン]]
[[Category:パッケージ開発]]
[[en:Font package guidelines]]
[[en:Font package guidelines]]
[[pt:Font package guidelines]]
[[pt:Font package guidelines]]
[[zh-hans:Font package guidelines]]
{{Package Guidelines}}
{{Package Guidelines}}


このドキュメントは、[[フォント]] の [[PKGBUILD]] の記述に関する提案された標準ガイドラインをカバーしています。
This document covers proposed standards and guidelines on writing [[PKGBUILD]]s for [[Fonts]].


== 一般的なガイドライン ==
== General guidelines ==


=== Package naming ===
=== パッケージの命名 ===


* [[wikipedia:TrueType|TTF]] fonts: {{ic|ttf-''fontname''}}
* [[wikipedia:ja:TrueType|TTF]] フォント: {{ic|ttf-''fontname''}}
* [[wikipedia:OpenType|OTF]] fonts: {{ic|otf-''fontname''}}
* [[wikipedia:ja:OpenType|OTF]] フォント: {{ic|otf-''fontname''}}


If the font is a [[Wikipedia:Variable fonts|variable font]], add the suffix {{ic|-variable}}.
フォントが [https://en.wikipedia.org/wiki/Variable_font variable font] の場合は、接尾辞 {{ic|-variable}} を追加します。


{{Note|パッケージ名は完全に小文字にする必要があります。}}
{{Note|The package name should be entirely lowercase.}}


=== Package description ===
=== パッケージの説明 ===


パッケージの説明には少なくとも ''font'' という単語と、sans-serif, serif, monospace のうちどの種類のフォントなのかを含める必要があります。
The package description should at least contain the word ''font'' and what type of font it is: sans-serif, serif or monospace.


=== Architecture ===
=== アーキテクチャ ===


フォントはアーキテクチャに依存しません。{{ic|1=arch=(any)}} を使ってください。
Fonts are architecture-independent. Use {{ic|1=arch=(any)}}.


=== Dependencies ===
=== 依存関係 ===


フォントは何かに依存しているわけではありません。しかし、リポジトリにある多くのパッケージは、{{Pkg|fontconfig}} と {{Pkg|xorg-mkfontscale}} を依存関係として含んでいます。これらはフォントパッケージがフォントキャッシュを更新するためにインストールスクリプトを使う必要があったときに必要でした。現在では多くの重複した作業は [[pacman フック]] によって行われています。fontconfig や xorg-mkfontscale をインストールすると、{{ic|/usr/share/fonts/}} にある全ての既存フォントがキャッシュされ、fontconfig や mkfontscale を使うことを強制する必要はありません。
Fonts do not depend on anything. Many packages in the repositories, however, include {{Pkg|fontconfig}} and {{Pkg|xorg-mkfontscale}} as dependecies. Those were required when font packages needed to use install scripts to update the font cache – a lot of duplicate work now done by [[pacman hooks]]. If you install fontconfig or xorg-mkfontscale, all existing fonts in {{ic|/usr/share/fonts/}} will be cached making it unnecessary to force people to use fontconfig or mkfontscale.


=== Provides ===
=== 提供するもの ===


Many applications rely on the virtual package {{ic|ttf-font}}. If your font family meets the [https://archlinux.org/todo/fix-ttf-font-default-font-setup criteria], add {{ic|1=provides=('ttf-font')}}.
多くのアプリケーションは仮想パッケージ {{ic|ttf-font}} に依存しています。あなたのフォントファミリーが [https://archlinux.org/todo/fix-ttf-font-default-font-setup criteria] を満たすなら、{{ic|1=provides=('ttf-font')}} を追加してください。


=== Source ===
=== 出典 ===


以下のソースからフォントが利用可能かどうかを、この順番で確認します。
See whether a font is available from the following sources in this order:


* GitHub のようなコードホスティングプラットフォームまたは公式ウェブサイト
* a code hosting platform like GitHub or an official website
* [https://fonts.google.com Google Fonts]: {{ic|<nowiki>https://fonts.google.com/download?family=</nowiki>''Name''}}
* [https://fonts.google.com Google Fonts]: {{ic|<nowiki>https://fonts.google.com/download?family=</nowiki>''Name''}}.
* [https://www.fontsquirrel.com Font Squirrel], [https://fontlibrary.org Font Library], [https://www.ffonts.net FFonts], [https://www.1001freefonts.com 1001 Fonts], [https://www.1001freefonts.com 1001 Free Fonts], [https://www.dafont.com DaFont]
* [https://www.fontsquirrel.com Font Squirrel], [https://fontlibrary.org Font Library], [https://www.ffonts.net FFonts], [https://www.1001freefonts.com 1001 Fonts], [https://www.1001freefonts.com 1001 Free Fonts], [https://www.dafont.com DaFont]


以下のサイトは推奨できません。
The following sites are not recommended:


* [https://www.fontspace.com FontSpace] (checksums change for unknown reasons)
* [https://www.fontspace.com FontSpace] (チェックサムが原因不明で変更される)


== Package ==
== パッケージ ==


次のスニペットは、OFL(SIL Open Font License)の下でリリースされた OTF フォントの例です。
The following snippet is an example for an OTF font released under the OFL (SIL Open Font License):


{{bc|<nowiki>
{{bc|<nowiki>
58行目: 59行目:
</nowiki>}}
</nowiki>}}


* The [[Wikipedia:SIL_Open_Font_License|OFL]] is technically a [[PKGBUILD#license|custom license]], so each font package's license file needs to be installed under {{ic|/usr/share/licenses/$pkgname}}.
* [[Wikipedia:ja:SIL_Open_Font_License|OFL]] は技術的には [[PKGBUILD#license|custom license]] ですので、各フォントパッケージのライセンスファイルは {{ic|/usr/share/licenses/$pkgname}} にインストールする必要があります。
* フォントに多くのフォントファイルが含まれている場合、インストール先のディレクトリに {{ic|OTF}} の代わりに {{ic|$pkgname}} を使うことを検討してください。
* If the font contains many font files, consider using {{ic|$pkgname}} instead of {{ic|OTF}} for the destination directory.


== Example packages ==
== パッケージ例 ==


* {{AUR|ttf-merriweather-sans}}
* {{AUR|ttf-merriweather-sans}}
* {{AUR|otf-commissioner}} – split package with OTF, TTF and variable version
* {{AUR|otf-commissioner}} – OTF, TTF, variable バージョンを含むスプリットパッケージ


== See also ==
== 参照 ==


* [https://bbs.archlinux.org/viewtopic.php?pid=1888912 Forum discussion] concerning this article
* [https://bbs.archlinux.org/viewtopic.php?pid=1888912 Forum discussion] この記事について

2023年6月30日 (金) 02:02時点における最新版

このドキュメントは、フォントPKGBUILD の記述に関する提案された標準ガイドラインをカバーしています。

一般的なガイドライン

パッケージの命名

  • TTF フォント: ttf-fontname
  • OTF フォント: otf-fontname

フォントが variable font の場合は、接尾辞 -variable を追加します。

ノート パッケージ名は完全に小文字にする必要があります。

パッケージの説明

パッケージの説明には少なくとも font という単語と、sans-serif, serif, monospace のうちどの種類のフォントなのかを含める必要があります。

アーキテクチャ

フォントはアーキテクチャに依存しません。arch=(any) を使ってください。

依存関係

フォントは何かに依存しているわけではありません。しかし、リポジトリにある多くのパッケージは、fontconfigxorg-mkfontscale を依存関係として含んでいます。これらはフォントパッケージがフォントキャッシュを更新するためにインストールスクリプトを使う必要があったときに必要でした。現在では多くの重複した作業は pacman フック によって行われています。fontconfig や xorg-mkfontscale をインストールすると、/usr/share/fonts/ にある全ての既存フォントがキャッシュされ、fontconfig や mkfontscale を使うことを強制する必要はありません。

提供するもの

多くのアプリケーションは仮想パッケージ ttf-font に依存しています。あなたのフォントファミリーが criteria を満たすなら、provides=('ttf-font') を追加してください。

出典

以下のソースからフォントが利用可能かどうかを、この順番で確認します。

以下のサイトは推奨できません。

  • FontSpace (チェックサムが原因不明で変更される)

パッケージ

次のスニペットは、OFL(SIL Open Font License)の下でリリースされた OTF フォントの例です。

license=('OFL')
...
package() {
  install -Dm644 -t "$pkgdir/usr/share/fonts/OTF" "path/to/font/*.otf"
  install -Dm644 -t "$pkgdir/usr/share/licenses/$pkgname" "path/to/license/OFL.txt"
}
  • OFL は技術的には custom license ですので、各フォントパッケージのライセンスファイルは /usr/share/licenses/$pkgname にインストールする必要があります。
  • フォントに多くのフォントファイルが含まれている場合、インストール先のディレクトリに OTF の代わりに $pkgname を使うことを検討してください。

パッケージ例

参照