Skip to main content
Help us improve PyPI by participating in user testing. All experience levels needed!

Freetype python bindings

Project description

FreeType high-level python API

Freetype python provides bindings for the FreeType library. Only the high-level API is bound.

Documentation available at:


To be able to use freetype python, you need the freetype library version 2
installed on your system.

Mac users

Freetype should be already installed on your system. If not, either install it
using `homebrew <>`_ or compile it and place the library binary
file in '/usr/local/lib'.

Linux users

Freetype should be already installed on your system. If not, either install
relevant package from your package manager or compile from sources and place
the library binary file in '/usr/local/lib'.

Window users

There are no official Freetype binary releases available, but they offer some
links to precompiled Windows DLLs. Please see the `FreeType Downloads
<>`_ page for links.
You can also compile the FreeType library from source.

32-Bit vs 64-Bit on Windows

If you are using freetype-py on Windows with a 32-Bit version of python, you
need the 32-Bit version of the Freetype binary. The same applies for a 64-Bit
version of python.

Installation on Windows

Because of the way Windows searches for dll files, make sure the resulting
file is named 'freetype.dll' (and not something like Freetype245.dll).
Windows expects the library in one of the directories listed in the $PATH
environment variable. As it is not recommended to place the dll in a Windows
system folder, you can choose one of the following ways to solve this:

* Place library in a folder of your choice and edit the $PATH user
environment variable
* Place library in a folder of your choice and edit the $PATH system
environment variable
* For development purpose, place the library in the working directory of
the application
* Place the library in one of the existing directories listed in $PATH

To get a complete list of all the directories in the $PATH
environment variable (user and system), open a command promt and type
.. code::
echo %PATH%

Usage example

.. code:: python

import freetype
face = freetype.Face("Vera.ttf")
face.set_char_size( 48*64 )
bitmap = face.glyph.bitmap
print bitmap.buffer


Screenshot below comes from the example. No clever tricks here, just
brute force.

.. image::

Screenshots below comes from the and
examples showing how to access a glyph outline information and use it to draw
the glyph. Rendering (with Bézier curves) is done using matplotlib.

.. image::
.. image::

Screenshot below comes from the showing how to draw and combine
a glyph outline with the regular glyph.

.. image::

The screenshot below comes from the example showing how to draw
text in a bitmap (that has been zoomed in to show antialiasing).

.. image::

The screenshot below comes from the example showing an
implementation of ideas from the `Texts Rasterization Exposures
<>`_ by
Maxim Shemarev.

.. image::


* Titusz Pan (bug report)
* Ekkehard.Blanz (bug report)
* Jānis Lībeks (bug report)
* Frantisek Malina (typo)
* Tillmann Karras (bug report & fix)
* Matthew Sitton (bug report & fix)
* Tao Gong (bug report)
* Matthew Sitton (Remove raw interfaces from the file)
* Daniel McCloy (Adde glyph_name function)

Project details

Release history Release notifications

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
freetype-py-1.2.1.tar.gz (181.7 kB) Copy SHA256 hash SHA256 Source None Feb 24, 2018

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page