Skip to the text
KDOS
Menu
kdos.dev KDOS from Scratch KDOS 0.2 · 4dd4a10 · 2026-11-30 Contents Index

310.2. font-manager-0.9.4

Font Manager and Font Viewer: browse, compare, preview and enable fonts, for GTK 4

Version 0.9.4, release 1
Shelf fonts — Font packages, and font libraries and tooling
Phase 44_apps (Applications), 135 of 422 in build order
Licence GPL-3.0-or-later
Homepage https://fontmanager.github.io/
Build time 2.6 SBU
Installed size 9.5 MiB in 25 files
Recipe ports/core/fonts/font-manager/kpkgbuild

About

Font Manager is a GTK 4 program, written in Vala, for browsing, comparing and previewing the installed fonts and enabling or disabling them for the user through fontconfig. The package carries two programs: Font Manager itself, and Font Viewer, which previews one font file and installs it for the current user.

Sources

Dependencies

Depends on: meson, ninja, pkgconf, vala, gettext, python3, glib, gobject-introspection, gtk4, pango, json-glib, libxml2, sqlite, fontconfig, freetype2, harfbuzz, libarchive, librsvg, hicolor-icon-theme.

Required by: no port names it.

Optional, off in KDOS

These switches in build.sh turn off a feature whose library is a port here. The recipe may turn each off on purpose, or because the library was not yet a port when the recipe was written; this list cannot tell which.

Patches

build.sh applies these; kpkg applies nothing by itself.

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 font-manager'

What kpkg does

kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/fonts/font-manager.

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/font-manager
echo '6a0899ac753f50d0779751828c62fa6220024213ebd2179b6f64a3a9bff51f96  font-manager-0.9.4.tar.xz' | 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/font-manager
SRC=$SRC_ROOT/font-manager-0.9.4
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf font-manager-0.9.4.tar.xz -C "$SRC" --strip-components=1

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 five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:

patch -p1 -i "$PORT_SRC/vala-0.56.19.patch"

meson setup build --prefix=/usr --sysconfdir=/etc --libdir=lib \
	--buildtype=release \
	-Dmanager=true \
	-Dviewer=true \
	-Dsearch-provider=false \
	-Dadwaita=false \
	-Dwebkit=false \
	-Dlibarchive=true \
	-Dyelp-doc=false \
	-Denable-nls=false \
	-Dunihan=true \
	-Dnautilus=false \
	-Dnemo=false \
	-Dthunar=false \
	-Dgtk-doc=false \
	-Dreproducible=true \
	-Dapp-armor=false
meson compile -C build
DESTDIR=$PKG meson install --no-rebuild -C build

for id in com.github.FontManager.FontManager com.github.FontManager.FontViewer; do
	for s in 48 64 128 256; do
		install -d "$PKG/usr/share/icons/hicolor/${s}x${s}/apps"
		rsvg-convert -w $s -h $s -o "$PKG/usr/share/icons/hicolor/${s}x${s}/apps/$id.png" \
			data/com.github.FontManager.FontManager.svg
	done
done

cat > "$PKG/usr/share/applications/com.github.FontManager.FontManager.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=Font Manager
GenericName=Font Manager
Comment=Browse, compare, enable and disable installed fonts
Exec=font-manager %u
Icon=com.github.FontManager.FontManager
Terminal=false
StartupNotify=true
StartupWMClass=com.github.FontManager.FontManager
Categories=GTK;Utility;Graphics;
Keywords=font;typeface;glyph;character;preview;compare;
EOF
cat > "$PKG/usr/share/applications/com.github.FontManager.FontViewer.desktop" <<'EOF'
[Desktop Entry]
Type=Application
Name=Font Viewer
GenericName=Font Viewer
Comment=Preview a font file and install it for this user
Exec=/usr/libexec/font-manager/font-viewer %u
Icon=com.github.FontManager.FontViewer
Terminal=false
StartupNotify=true
StartupWMClass=com.github.FontManager.FontViewer
MimeType=font/ttf;font/otf;font/collection;
Categories=GTK;Utility;Graphics;
Keywords=font;typeface;glyph;preview;install;
EOF
chmod 644 "$PKG/usr/share/applications/com.github.FontManager.FontManager.desktop" \
	"$PKG/usr/share/applications/com.github.FontManager.FontViewer.desktop"

The switches, and why each is set:

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/font-manager, 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 font-manager-0.9.4-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/font-manager, and runs the triggers its paths call for.

Contents

Installed programs: font-manager.

Installed directories: /usr/lib/font-manager, /usr/libexec/font-manager, /usr/share/licenses/font-manager.

Short descriptions

font-manager Simple font management for GTK+ desktop environments

Notes

Upstream installs one SVG icon for the two programs. build.sh renders it with rsvg-convert from librsvg into hicolor PNGs, in four sizes, under both application ids.

Upstream’s two desktop entries are replaced. Each new entry carries its program’s GApplication id, com.github.FontManager.FontManager or com.github.FontManager.FontViewer, as its StartupWMClass, since that id is the window’s Wayland app_id; upstream’s entries name font-manager and font-viewer. Only the viewer claims the font types, so a font file has one handler rather than a choice between two windows of the same package, and the types it claims are the MIME database’s canonical names (font/ttf, font/otf, font/collection): the desktop resolves a file to one of those from its name, so an alias or an unknown type never matches.