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 givenpkg-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
-DSDL2TTF_VENDORED=OFF— Builds against the root’s FreeType and HarfBuzz instead of the complete copies of both that the release tarball carries underexternal/. This is upstream’s default everywhere but MSVC and Android; named here, it keeps a second FreeType and HarfBuzz out of the library.-DSDL2TTF_HARFBUZZ=ON— Shapes text with HarfBuzz. Upstream’s default is off, and without it SDL2_ttf places one glyph per character from the font’s character map and kerning alone.-DSDL2TTF_SAMPLES=OFF— Builds none of the sample programs, which upstream builds by default when SDL2_ttf is the top-level project.
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.