FreeType Development

Accessing the Source Code

There are several ways to access the source code for the FreeType packages.

  • Download a source archive

    This is for browsing, compiling, and using the source code locally.

  • Use git access

    FreeType's git repositories are available from freedesktop.org's gitlab instance.

    git clone https://gitlab.freedesktop.org/freetype/freetype.git
    git clone https://gitlab.freedesktop.org/freetype/freetype-demos.git
  • Use anonymous CVS access

    Other, no longer maintained FreeType repositories (which exist for historical interest only) can be downloaded from Savannah through CVS and viewed here. Use the following value for the CVSROOT environment variable (or the equivalent -d command line option of the cvs client):

    :pserver:anonymous@cvs.sv.nongnu.org:/sources/freetype

    When asked for a password, simply press Enter for cvs login. The module names are freetype (Freetype version 1.x, C code), freetype1-contrib (contributed programs), and ftpascal (Freetype version 1.x, Pascal code).

    The freetype2 and ft2demos modules have been transformed to git (see above) and shouldn't be used anymore.

Reporting a Bug

In case you find a bug, which you think is related to FreeType, please check the problematic font with one of our demo programs, for example ftview or ftstring. In case the problem persists, consult FreeType's issue list to find out whether the problem has been reported already. Otherwise, please submit a new issue. It is helpful to use the git version (see above) of FreeType and its demo programs for testing if possible since we don't release FreeType very often.

Submitting Patches

For larger changes please provide merge requests. Alternatively, you can submit patches to the freetype-devel@nongnu.org mailing list – and thank you in advance for your work on improving FreeType!

Here are some tips on making your contribution easy to integrate into the FreeType git repositories.

  • In the preamble of your patch, add a description of your changes similar to the entries in the ChangeLog file. With ‘similar’ it is meant that the format and style of ChangeLog entries should be imitated as much as possible. However, don't modify the ChangeLog file by yourself.
  • Try to follow the formatting of the source code as much as possible.
  • If you plan to contribute larger changes, split them into smaller, logical units. Reviewing code changes in small, incremental steps is much easier to perform.

Language Bindings

For a couple of programming languages there exist wrappers around FreeType. Note that some of them are quite old and probably no longer maintained.

Caml

Bindings are part of the CamlImages package.

D

Bindings are available in BindBC-FreeType.

Factor

This dynamic programming language comes with FreeType bindings.

Perl

More than a single binding package is available. Try here for a search on CPAN.

Python

Bindings are available here. Pillow, the successor of the Python Imaging Library (PIL), can be built to use FreeType for font rendering, giving high-level access to fonts.

A more extensive set of Python bindings, designed to work together to cover the main parts of the Linux typography stack, are

Ruby

See rubygems for bindings.

Rust

Crates, the Rust Package Registry, shows a list of bindings here.

Zig

See mach-freetype, which comes with zero-fuss installation, cross compilation and ~99% API coverage.

Support Tools

One of the simplest way to compile FreeType is from the command line using one of the following tools.

GNU Make

FreeType comes with a sophisticated build system that is based on GNU Make. This really means a set of Makefiles and sub-Makefiles that are used to perform the following operations.

  • Detect the current operating system in order to select the appropriate default compiler settings for the build.

  • Select the settings corresponding to a given compiler for a given platform. For example, on Windows, the following compilers are supported: Visual C++, GCC, Borland C++, Watcom C++, Win32-LCC. On Unix, gcc, lcc and standard cc are also supported through a traditional configure script.

  • Build the list of FreeType modules automatically from the sub-directories present in the src directory.

  • Finally, build the library and its module as a static library or DLL, depending on the platform and compiler.

The build system is capable of supporting several compilers, on several platforms. However, you must have a recent version of GNU Make installed to use it. The build does not work with other make tools (like BSD Make, NMake, etc.).

See the download section for binaries of GNU Make for Windows.

Meson

Right now, support for Meson is experimental and available for the library only, without the demo programs. It is planned to fix this eventually, making Meson a first-class build system.

CMake

FreeType can also be built with CMake. Note, however, that this is contributed code not officially supported.

Last update: 25-Feb-2024