Font package guidelines: Difference between revisions

From ArchWiki
(Add links to other languages)
(→‎Source: fonts.google.com no longer works)
 
(2 intermediate revisions by 2 users not shown)
Line 2: Line 2:
[[ja:フォントパッケージガイドライン]]
[[ja:フォントパッケージガイドライン]]
[[pt:Font package guidelines]]
[[pt:Font package guidelines]]
[[zh-hans:Font package guidelines]]
{{Package guidelines}}
{{Package guidelines}}


Line 38: Line 39:


* a code hosting platform like GitHub or an official website
* 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://github.com/google/fonts github.com/google/fonts] (you should download individual files instead of cloning the repository, see [https://gitlab.archlinux.org/archlinux/packaging/packages/ttf-roboto-mono/-/blob/34918d39c7f09abc9ac2f2324fba029c7396e693/PKGBUILD ttf-roboto-mono] for an example)
* [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:
The following sites are not recommended:


* [https://fonts.google.com fonts.google.com] (it [https://github.com/google/fonts/issues/7481 no longer provides stable download URLs])
* [https://www.fontspace.com FontSpace] (checksums change for unknown reasons)
* [https://www.fontspace.com FontSpace] (checksums change for unknown reasons)


== Package ==
== Package ==


The following snippet is an example for an OTF font released under the OFL (SIL Open Font License):
The following snippet is an example for an OTF font released under the [https://spdx.org/licenses/OFL-1.1-RFN.html SIL Open Font License 1.1 with Reserved Font Name]:


{{bc|<nowiki>
{{bc|<nowiki>
license=('OFL')
license=('OFL-1.1-RFN')
...
...
package() {
package() {

Latest revision as of 13:23, 3 April 2024

Arch package guidelines

32-bitCLRCMakeCrossDKMSEclipseElectronFontFree PascalGNOMEGoHaskellJavaKDEKernelLispMesonMinGWNode.jsNonfreeOCamlPerlPHPPythonRRubyRustShellVCSWebWine

This document covers proposed standards and guidelines on writing PKGBUILDs for Fonts.

General guidelines

Package naming

  • TTF fonts: ttf-fontname
  • OTF fonts: otf-fontname

If the font is a variable font, add the suffix -variable.

Note: The package name should be entirely lowercase.

Package description

The package description should at least contain the word font and what type of font it is: sans-serif, serif or monospace.

Architecture

Fonts are architecture-independent. Use arch=(any).

Dependencies

Fonts do not depend on anything. Many packages in the repositories, however, include fontconfig and 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 /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 ttf-font. If your font family meets the criteria, add provides=('ttf-font').

Source

See whether a font is available from the following sources in this order:

The following sites are not recommended:

Package

The following snippet is an example for an OTF font released under the SIL Open Font License 1.1 with Reserved Font Name:

license=('OFL-1.1-RFN')
...
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"
}
  • The OFL is technically a custom license, so each font package's license file needs to be installed under /usr/share/licenses/$pkgname.
  • If the font contains many font files, consider using $pkgname instead of OTF for the destination directory.

Example packages

See also