freetypy.Face

class freetypy.Face

Models a given typeface, in a given style.

Parameters:
  • file (path, or readable file-like object) – The file containing the face data.
  • face_index (int, optional) – The index of the face within the font. The first face has index 0.
Returns:

face

Return type:

Face instance

__init__()

x.__init__(...) initializes x; see help(type(x)) for signature

Methods

attach ‘Attach’ data to a face object.
get_char_index Get the glyph index of a given char code.
get_char_index_unicode ⨎ Get the glyph index of a given Unicode character.
get_char_name ⨎ Get the glyph name of the given unicode code point.
get_char_variant_index Get the glyph id of a char code as modified by the variant selector.
get_chars Iterate over all of the char codes in the current charmap.
get_fstype_flags Get the FSTYPE flags for a font.
get_glyph_name Get the ASCII name of the given glyph in a face.
get_kerning Get the kerning vector between two glyphs of a same face.
get_name_index Get the glyph index of a given glyph name.
get_postscript_name Get the ASCII PostScript name of a given face, if available.
get_track_kerning Get the track kerning for a given face object at a given size.
has_ps_glyph_names Return True if a given face provides reliable PostScript glyph names.
load_char Load a single glyph, according to its char code.
load_char_unicode ⨎ Load a single glyph, from a given unicode character.
load_glyph Load a single glyph.
request_size Resize the scale of the active Size object in a face.
select_charmap Select a given charmap by its encoding tag.
select_size Select a bitmap strike.
set_char_size Set the nominal font size (in points).
set_charmap Select a charmap for char code to glyph index mapping.
set_transform Set the transformation applied to glyph images.

Attributes

ascender The typographic ascender of the face, expressed in font units.
available_sizes An list of Bitmap_Size objects for all bitmap strikes in the face.
bbox The font bounding box.
charmap The currently active CharMap.
charmaps A list of CharMap objects.
descender The typographic descender of the face, expressed in font units.
face_flags A set of FACE_FLAG flags that give important information about the face.
face_index The index of the face in the font file.
family_name The face’s family name.
filename ⨎ The argument used to initialize the font.
glyph The face’s currently loaded glyph slot.
has_horizontal Horizontal metrics are present.
has_kerning Kerning data is present.
has_vertical Vertical metrics are present.
height The vertical distance between two consecutive baselines, expressed in font units.
is_fixed_width Contains fixed-width (or ‘monospace’) glyphs.
is_scalable Is a scalable Face.
is_sfnt Based on the SFNT storage scheme.
max_advance_height The maximum advance height, in font units, for all glyphs in this face.
max_advance_width The maximum advance width, in font units, for all glyphs in this face.
num_faces The number of faces in the font file.
num_glyphs The number of glyphs in the face.
sfnt_names Get a SfntNames list of SfntName entries for the Face.
size The currently active size.
style_flags A set of STYLE_FLAG flags indicating the style of the face.
style_name The face’s style name.
tt_header The TrueType header (TT_Header).
tt_horiheader The TrueType horizontal header (TT_HoriHeader).
tt_os2 The OS/2 TrueType header (TT_OS2).
tt_pclt The PCLT header (TT_Pclt).
tt_postscript The Postscript header (TT_Postscript).
tt_vertheader The TrueType vertical header (TT_VertHeader).
underline_position The position of the underline line, in font units.
underline_thickness The thickness of the underline, in font units.
units_per_em The number of font units per EM square.