Font package guidelines
32-bit – CLR – CMake – Cross – Eclipse – Electron – Font – Free Pascal – GNOME – Go – Haskell – Java – KDE – Kernel – Lisp – MinGW – Node.js – Nonfree – OCaml – Perl – PHP – Python – R – Ruby – Rust – VCS – Web – Wine
This document covers proposed standards and guidelines on writing PKGBUILDs for Fonts.
Contents
General guidelines
Package naming
If the font is a variable font, add the suffix -variable
.
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:
- a code hosting platform like GitHub or an official website
-
Google Fonts:
https://fonts.google.com/download?family=''Name''
- Font Squirrel, FontSpace, Font Library, 1001 Free Fonts, DaFont
Package
The following snippet is an example for an OTF font under the OFL (SIL Open Font License). If the font contains many font files, consider using $pkgname
instead of OTF
for the destination directory:
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" }
Example packages
- ttf-merriweather-sansAUR – downloads files of a specific commit from GitHub because upstream does not provide releases
- otf-commissionerAUR – split package with OTF, TTF and variable version