Platforms and Testing
Requirements
| Library | Version | Needed by |
|---|---|---|
HarfBuzz (libharfbuzz) |
7.0 or newer | cl-textrender |
ICU (libicuuc) |
52 or newer | cl-textrender |
FreeType (libfreetype) |
2.13.1 or newer | cl-textrender/raster, cl-textrender/atlas |
The Lisp dependencies are cl-icu, cl-harfbuzz, cl-ft2, cl-atlas and cl-sdf,
and cl-ffi, which the bindings call C
through, all from their git repositories. cl-atlas and cl-sdf
are pure Lisp, so cl-textrender/sdf needs no library beyond HarfBuzz and
ICU. See Getting Started for installing them.
ICU is found whatever its major version: cl-icu finds the version suffix
of the ICU the process loads, so an ICU upgrade needs no recompile. On
Windows, cl-icu uses the icu.dll that ships with Windows 10 version 1903
and later. See each library's documentation for where it looks for its
shared library.
Lisp implementation
cl-textrender runs on SBCL. The code is portable Common Lisp apart from the
locks and the finalizers that free faces and fonts, in the internal package
cl-textrender/sys of the core system. Its bindings call C through cl-ffi.
Running the tests
The suite is cl-textrender/test, written with
Parachute. It covers the core and
all three optional systems. From a checkout of cl-textrender:
stift test
The summary at the end gives the number of tests passed and failed.
asdf:test-system signals an error if any test fails, so the command exits unsuccessfully.
Fonts for the tests
The tests check exact positions, so they need particular fonts:
| Font | Debian/Ubuntu package | Used for | Override |
|---|---|---|---|
| DejaVu Sans | fonts-dejavu-core |
Most tests: TrueType outlines, metrics, Hebrew and Arabic | CL_TEXTRENDER_TEST_FONT |
| URW Bookman Light | fonts-urw-base35 |
CFF (cubic) outlines, font fallback | CL_TEXTRENDER_TEST_CFF_FONT |
| Droid Sans Fallback | fonts-droid-fallback |
Vertical text: CJK with vertical metrics and a vert feature |
CL_TEXTRENDER_TEST_CJK_FONT |
A variable font for the variation tests comes with cl-ft2's tests. To use fonts from other locations, set the environment variables to their paths.
On Debian or Ubuntu, everything the suite needs:
apt install libharfbuzz0b libicu-dev libfreetype6 \
fonts-dejavu-core fonts-urw-base35 fonts-droid-fallback
Continuous integration
CI runs the suite on every push to main and every pull request, with
SBCL 2.6.9 in a Debian forky container, installing the packages above.
Reporting a problem
When something is laid out wrongly, the useful details are the text (with
code points for anything unusual), the font file and size, the arguments
to layout-text, and what you expected. The versions of HarfBuzz and ICU
matter too: cl-harfbuzz:harfbuzz-version and cl-icu:icu-version report
them.