Ziafont reads TrueType/OpenType font files and draws characters and strings as SVG <path> elements. Unlike the SVG <text> element, the output of Ziafont’s SVG should render identically on any system, independent of whether the original font is available. However, the SVG will not be text-searchable, as characters are replaced by curves.

Currently, Ziafont supports fonts with TrueType glyph outlines contained in a “glyf” table in the font (these fonts typically have a .ttf extensions). Glyph outlines in a “CFF” table (typically fonts with the .otf extension) are not supported at this time. Kerning adjustment is supported if the font has a “GPOS” table.


import ziafont
font = ziafont.Font('NotoSerif-Regular.ttf')
s = font.text('Z').svg()
print(s[:80])  # Just show 80 characters here...
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlin


Ziafont can be installed using pip:

pip install ziafont

No dependencies are required.


If you appreciate Ziafont, buy me a coffee to show your support!

Source code is available on Bitbucket.

Ziafont is used by the Ziamath and Ziaplot Python packages.