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

249.1. fontforge-20251009

Outline and bitmap font editor: the GTK editor window, scripts and the Python module

Version 20251009, release 1
Shelf fonts — Font packages, and font libraries and tooling
Phase 43_toolkits (Toolkits), 5 of 344 in build order
Licence GPL-3.0-or-later
Homepage https://fontforge.org/
Build time 1.7 SBU
Installed size 12.8 MiB in 397 files
Recipe ports/core/fonts/fontforge/kpkgbuild

About

FontForge is an outline and bitmap font editor. The port builds its GTK 3 editor window, the fontforge command, which also runs FontForge’s native scripts (fontforge -script) and Python scripts without a window, and the fontforge Python module. The scripting half is what the font ports use at build time: ttf-dejavu and terminus-ttf compile their TrueType files from their drawing sources and bitmaps through it, and font-liberation’s make ttf-dir builds its faces with it.

Why it is in KDOS

The comment above it in script/phases/43_toolkits/packages.d/fonts.txt:

Edits faces in its GTK window and compiles them from a script or from Python. The script half is what turns DejaVu's drawing sources and Terminus's bitmaps into the TrueType files ttf-dejavu and terminus-ttf install.

Sources

Dependencies

Depends on: cmake, freetype2, gettext, glib, libxml2, zlib, libpng, libjpeg-turbo, libtiff, giflib, readline, python3, gtk3, gtkmm3, harfbuzz, woff2, libspiro.

Required by (3): font-liberation, terminus-ttf, ttf-dejavu.

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/43_toolkits/phase.env && kpkg install fontforge'

What kpkg does

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

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/fontforge
echo '69046500185a5581b58139dfad30c0b3d8128f00ebbfddc31f2fcf877e329e52  fontforge-20251009.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/fontforge
SRC=$SRC_ROOT/fontforge-20251009
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf fontforge-20251009.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/importlib-metadata-plugins.patch"

mkdir build
cd build
cmake .. -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DBUILD_SHARED_LIBS=ON -DBUILD_TESTING=OFF \
	-DENABLE_GUI=ON \
	-DENABLE_NATIVE_SCRIPTING=ON \
	-DENABLE_PYTHON_SCRIPTING=ON \
	-DENABLE_PYTHON_EXTENSION=ON \
	-DENABLE_LIBGIF=ON \
	-DENABLE_LIBJPEG=ON \
	-DENABLE_LIBPNG=ON \
	-DENABLE_LIBTIFF=ON \
	-DENABLE_LIBREADLINE=ON \
	-DENABLE_LIBSPIRO=ON \
	-DENABLE_WOFF2=ON \
	-DENABLE_HARFBUZZ=ON \
	-DENABLE_DOCS=OFF
make
make DESTDIR=$PKG install

cat > "$PKG/usr/share/applications/org.fontforge.FontForge.desktop" <<'DESKTOP'
[Desktop Entry]
Type=Application
Name=FontForge
GenericName=Font Editor
Comment=Draw, edit and convert outline and bitmap fonts
Exec=fontforge %F
TryExec=fontforge
Icon=org.fontforge.FontForge
Terminal=false
StartupWMClass=fontforge
Categories=Graphics;
MimeType=application/vnd.font-fontforge-sfd;application/x-font-type1;application/x-font-bdf;application/x-font-pcf;application/x-font-tex;font/woff;font/woff2;
Keywords=font;fonts;editor;glyph;typeface;TTF;OTF;
DESKTOP
chmod 644 "$PKG/usr/share/applications/org.fontforge.FontForge.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/fontforge, 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 fontforge-20251009-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/fontforge, and runs the triggers its paths call for.

Contents

Installed programs: fontforge, fontimage, fontlint, sfddiff.

Installed libraries: libfontforge.so.

Installed directories: /usr/share/fontforge, /usr/share/licenses/fontforge.

Short descriptions

fontforge create, modify, and view font files
fontimage produce a font thumbnail image
fontlint check a font
sfddiff compare two font files

Notes

build.sh replaces upstream’s desktop entry with its own. Upstream’s claims TrueType and OpenType files, which font-manager’s viewer claims as well; the replacement lists FontForge’s own .sfd and the Type 1, BDF, PCF, TeX and WOFF formats, so a double-clicked .ttf or .otf opens in the viewer rather than the editor. StartupWMClass=fontforge matches the window under Xwayland: the compositor takes the X window’s WM_CLASS instance as its app id, and GDK sets that to the program name, fontforge.