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

209.5. sdl2-ttf-2.24.0

Render TrueType and OpenType text into SDL2 surfaces, shaped by HarfBuzz

2.24.0-1 · Zlib · 0.1 SBU · 207.6 KiB, 12 files · 42_graphics, 94 of 189 · ports/core/game-libs/sdl2-ttf

Homepage: https://github.com/libsdl-org/SDL_ttf

Why it is in KDOS. The comment above the 9 ports from sdl2-image to sdl3-ttf in script/phases/42_graphics/packages.d/game-libs.txt:

The SDL satellites for SDL 2 and SDL 3. There is no sdl2-config: a build that asks for it is given pkg-config sdl2, and an SDL 2 program runs on SDL 3 through sdl2-compat.

SDL2_ttf renders TrueType and OpenType text into SDL 2 surfaces. It rasterises glyphs with freetype2 and, in this build, shapes each run of text with harfbuzz, so ligatures, combining marks and right-to-left and complex scripts come out as the font intends. It is built against sdl2-compat, so an SDL 2 program using it runs on sdl3.

Depends on: cmake, ninja, pkgconf, sdl2-compat, freetype2, harfbuzz.

Required by (11): cataclysm-dda, flare-engine, freeciv, grafx2, neverball, openmsx, ppsspp, python3-kivy, supertux, tuxpaint, widelands.

Sources: sdl2-ttf-2.24.0.tar.gz (12.7 MiB). Every step kpkg takes applies to this port.

Install: script/chroot/exec.sh bash -c 'source script/phases/42_graphics/phase.env && kpkg install sdl2-ttf'

build.sh:

mkdir -p build && cd build
cmake .. -G Ninja \
	-DCMAKE_BUILD_TYPE=Release \
	-DCMAKE_INSTALL_PREFIX=/usr \
	-DBUILD_SHARED_LIBS=ON \
	-DSDL2TTF_VENDORED=OFF \
	-DSDL2TTF_HARFBUZZ=ON \
	-DSDL2TTF_SAMPLES=OFF
ninja
DESTDIR=$PKG ninja install

Libraries: libSDL2_ttf-2.0.so, libSDL2_ttf.so.

Directories: /usr/lib/cmake/SDL2_ttf, /usr/share/licenses/SDL2_ttf, /usr/share/licenses/sdl2-ttf.