freetypy.Face¶
-
class
freetypy.
Face
¶ A face object 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 : Face instance
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 current active CharMap
for this face.charmaps
A list of CharMap
objects in the face.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. Is usually a glyph
The face’s associated glyph slot. has_horizontal
True
whenever a face object contains horizontal metrics.has_kerning
True
whenever a face object contains kerning data.has_vertical
True
whenever a face object contains real vertical metrics.height
This value is the vertical distance between two consecutive baselines, expressed in font units. is_fixed_width
True
whenever a font face contains fixed-width (or ‘monospace’) glyphs.is_scalable
True
whenever a face object contains a scalable font face.is_sfnt
True
whenever font is 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 ofSfntName
entries for the Face.size
The current active size for this face. 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
) from the face.tt_horiheader
The TrueType horizontal header ( TT_HoriHeader
) from the face.tt_os2
The OS/2 TrueType header ( TT_OS2
) from the face.tt_pclt
The PCLT header ( TT_Pclt
) from the face.tt_postscript
The Postscript header ( TT_Postscript
) from the face.tt_vertheader
The TrueType vertical header ( TT_VertHeader
) from the face.underline_position
The position, in font units, of the underline line for this face. underline_thickness
The thickness, in font units, of the underline for this face. units_per_em
The number of font units per EM square for this face. Methods
attach
‘Attach’ data to a face object. get_char_index
Return the glyph index of a given character code. get_char_index_unicode
⨎ Return the glyph index of a given Unicode character. get_char_name
⨎ Returns the glyph name of the given unicode code point. get_char_variant_index
Return the glyph index of a given character code as modified by the variation selector. get_chars
Returns an iterator over all of the character codes in the current charmap. get_fstype_flags
Return the FSTYPE
flags for a font, which indicate the licensing for embedding and subsetting a font.get_glyph_name
Retrieve the ASCII name of the given glyph in a face. get_kerning
Return the kerning vector between two glyphs of a same face. get_name_index
Return the glyph index of a given glyph name. get_postscript_name
Retrieve the ASCII PostScript name of a given face, if available. get_track_kerning
Return 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 character 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
Request a nominal font size (in points). set_charmap
Select a charmap for character code to glyph index mapping. set_transform
Set the transformation that is applied to glyph images.