310.1. terminus-ttf-4.49.3
Scalable TTF build of Terminus, for the consumers that cannot draw a bitmap font
| Version | 4.49.3, release 1 |
| Shelf | fonts — Font packages, and font libraries and tooling |
| Phase | 44_apps (Applications), 134 of 422 in build order |
| Licence | OFL-1.1 |
| Homepage | https://files.ax86.net/terminus-ttf/ |
| Build time | 17.3 SBU |
| Installed size | 2.0 MiB in 5 files |
| Recipe | ports/core/fonts/terminus-ttf/kpkgbuild |
About
Terminus TTF is the Terminus face as a scalable TrueType font, for the programs that draw text through Pango, which renders no bitmap fonts. It is compiled here from the same BDF sources the terminus-font port builds the console and bitmap fonts from, with upstream’s own pipeline, mkttf: every pixel size goes into one face as a bitmap strike, the largest is traced into curves with potrace, and FontForge writes the TrueType file. The family is Terminus (TTF), distinct from the bitmap Terminus, so a program that asks for Terminus by name keeps drawing the bitmap, and only the programs that ask for Terminus (TTF) get this one.
Sources
terminus-font-4.49.1.tar.gz(633.1 KiB)
sha256d961c1b781627bf417f9b340693d64fc219e0113ad3a3af1a3424c7aa373ef79
upstream: https://downloads.sourceforge.net/project/terminus-font/terminus-font-4.49/terminus-font-4.49.1.tar.gz
archive copy: sources-2/fonts--terminus-font-4.49.1.tar.gzmkttf-f54356cd481b9f2c6b52c9cd010cfe3e38924e6a.tar.gz(12.3 KiB)
sha256ab7e9fc2192604e6af73830ab3cec54e90e9a954f37d69bcef825e6cc7d8c6f2
upstream: https://github.com/Tblue/mkttf/archive/f54356cd481b9f2c6b52c9cd010cfe3e38924e6a.tar.gz
archive copy: sources-2/fonts--mkttf-f54356cd481b9f2c6b52c9cd010cfe3e38924e6a.tar.gzmkbold-mkitalic-0.11.tar.gz(21.4 KiB)
sha2566249a6eebbf0e4bd585b2d7a7b6c5804c323b0e1ac5bcbe890b500ad8b0e7aea
upstream: https://gitlab.com/unshumikan/mkbold-mkitalic/-/archive/0.11/mkbold-mkitalic-0.11.tar.gz
archive copy: sources-2/fonts--mkbold-mkitalic-0.11.tar.gz
Dependencies
Depends on: fontconfig, fontforge, potrace, imagemagick, python3.
Required by (1): kdos-plasma-look.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/44_apps/phase.env && kpkg install terminus-ttf'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/fonts/terminus-ttf.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/fonts/terminus-ttf
echo 'd961c1b781627bf417f9b340693d64fc219e0113ad3a3af1a3424c7aa373ef79 terminus-font-4.49.1.tar.gz' | sha256sum -c -
echo 'ab7e9fc2192604e6af73830ab3cec54e90e9a954f37d69bcef825e6cc7d8c6f2 mkttf-f54356cd481b9f2c6b52c9cd010cfe3e38924e6a.tar.gz' | sha256sum -c -
echo '6249a6eebbf0e4bd585b2d7a7b6c5804c323b0e1ac5bcbe890b500ad8b0e7aea mkbold-mkitalic-0.11.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/terminus-ttf
SRC=$SRC_ROOT/terminus-ttf-4.49.3
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf terminus-font-4.49.1.tar.gz -C "$SRC" --strip-components=1
tar --no-same-permissions --warning=no-unknown-keyword -xf mkttf-f54356cd481b9f2c6b52c9cd010cfe3e38924e6a.tar.gz -C "$SRC_ROOT"
tar --no-same-permissions --warning=no-unknown-keyword -xf mkbold-mkitalic-0.11.tar.gz -C "$SRC_ROOT"
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers _terminus, _mkttf, _mkbold and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
make -C "$SRC_ROOT/mkbold-mkitalic-$_mkbold" CC="${CC:-cc}" mkitalic
mkttf="$SRC_ROOT/mkttf-$_mkttf"
year=$(date -u -d "@${SOURCE_DATE_EPOCH:-0}" +%Y)
bdf="$SRC_ROOT/bdf"
mkdir -p "$bdf"
cp ter-u*[nb].bdf "$bdf/"
for f in "$bdf"/ter-u*n.bdf; do
base=${f%n.bdf}
"$SRC_ROOT/mkbold-mkitalic-$_mkbold/mkitalic" < "$f" > "${base}i.bdf"
"$SRC_ROOT/mkbold-mkitalic-$_mkbold/mkitalic" < "${base}b.bdf" > "${base}BI.bdf"
done
for weight in Normal Bold Italic Bold-Italic; do
case $weight in
Normal) suffix=n; fname=TerminusTTF ; nice='Terminus (TTF)' ;;
Bold) suffix=b; fname=TerminusTTF-Bold ; nice='Terminus (TTF) Bold' ;;
Italic) suffix=i; fname=TerminusTTF-Italic ; nice='Terminus (TTF) Italic' ;;
Bold-Italic) suffix=BI; fname=TerminusTTF-Bold-Italic; nice='Terminus (TTF) Bold-Italic' ;;
esac
mkdir -p "$SRC_ROOT/out/$weight"
(
cd "$SRC_ROOT/out/$weight"
python3 "$mkttf/mkttf.py" \
-f 'Terminus (TTF)' -n "$fname" -N "$nice" \
-C "; Copyright (C) $year Tilman Blumenbach; Licensed under the SIL Open Font License, Version 1.1" \
-e AX86 -A ' -a 0' -V "$version" -O \
"$bdf"/ter-u*"$suffix".bdf
)
done
install -dm755 "$PKG/usr/share/fonts/TTF"
install -m644 "$SRC_ROOT"/out/*/*.ttf "$PKG/usr/share/fonts/TTF/"
install -Dm644 "$mkttf/terminus_ttf_distribution_license.txt" \
"$PKG/usr/share/licenses/$name/COPYING"
The switches, and why each is set:
CC="${CC:-cc}"— Builds mkitalic, from the mkbold-mkitalic source, with the tree’s compiler; its makefile namesgccoutright. mkitalic slants a BDF font, which is where the two italic faces come from. It is a build tool only and is not installed.-f 'Terminus (TTF)'— With-n "$fname"and-N "$nice": the family, the PostScript name (TerminusTTF,TerminusTTF-Bold, …) and the display name of each face, the names upstream’s ownmkttf.shgives them.-C— Appends the build year, the author and the SIL Open Font License notice to the copyright each face takes from its BDF, asmkttf.shdoes. The year comes fromSOURCE_DATE_EPOCH, not from the clock, so two builds of one recipe give the same file.-e AX86— The OS/2 vendor ID, upstream’s own; mkttf’s default is FontForge’sPfEd.-A ' -a 0'— Passes-a 0to potrace, its corner threshold at zero, so every corner of the traced outline stays sharp, as a pixel font’s should.-V "$version"— The font version written into each face: mkttf’s release number for this Terminus,versioninkpkgbuild, which differs from the Terminus release_terminus.-O— Has mkttf set the style bits itself, the OS/2 table’sfsSelectionand the head table’smacStyle(regular, bold, italic), from the face’s weight and name. Newer FontForge releases leave both to the script that builds the font.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/terminus-ttf, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf terminus-ttf-4.49.3-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/terminus-ttf, and runs the triggers its paths call for.
Contents
Installed directories: /usr/share/licenses/terminus-ttf.
Notes
build.sh runs the steps of upstream’s mkttf.sh itself, with the same mkttf.py arguments, rather than running the script, because the script stamps the clock’s year into every face. It works on a copy of the BDF files in $SRC_ROOT/bdf, where the italic BDFs are written, rather than in the source directory.
mkttf.py’s default tracer, potrace-wrapper.sh, enlarges each glyph with ImageMagick’s magick before potrace sees it, which is why imagemagick is in depends beside potrace and fontforge.
The four faces are installed in /usr/share/fonts/TTF, and mkttf’s distribution licence as the package’s COPYING.