Top

pyagg.fonthelper module

Lightweigt module for reading system font names from .ttf font files. Based on http://www.codeproject.com/Articles/2293/Retrieving-font-name-from-TTF-file Karim Bahgat, 2015

Functions

def get_fontname(

filepath)

Given a filepath to a .ttf font file, reads the font metadata and returns its font name.

def get_fontpath(

font)

Gets fontpath from either font name, fontfile name, or full fontfile path

def load_sysfonts(

)

Caches and returns a fontname-filepath mapping of available system fonts, by looking up SYSFONTFOLDERS. This function is run on startup, and the results can be accessed via the cached storage variable SYSFONTS.