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_indexGet 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_indexGet the glyph id of a char code as modified by the variant selector. get_charsIterate over all of the char codes in the current charmap. get_fstype_flagsGet the FSTYPEflags for a font.get_glyph_nameGet the ASCII name of the given glyph in a face. get_kerningGet the kerning vector between two glyphs of a same face. get_name_indexGet the glyph index of a given glyph name. get_postscript_nameGet the ASCII PostScript name of a given face, if available. get_track_kerningGet the track kerning for a given face object at a given size. has_ps_glyph_namesReturn Trueif a given face provides reliable PostScript glyph names.load_charLoad a single glyph, according to its char code. load_char_unicode⨎ Load a single glyph, from a given unicode character. load_glyphLoad a single glyph. request_sizeResize the scale of the active Sizeobject in a face.select_charmapSelect a given charmap by its encoding tag. select_sizeSelect a bitmap strike. set_char_sizeSet the nominal font size (in points). set_charmapSelect a charmap for char code to glyph index mapping. set_transformSet the transformation applied to glyph images. Attributes
ascenderThe typographic ascender of the face, expressed in font units. available_sizesAn list of Bitmap_Sizeobjects for all bitmap strikes in the face.bboxThe font bounding box. charmapThe currently active CharMap.charmapsA list of CharMapobjects.descenderThe typographic descender of the face, expressed in font units. face_flagsA set of FACE_FLAGflags that give important information about the face.face_indexThe index of the face in the font file. family_nameThe face’s family name. filename⨎ The argument used to initialize the font. glyphThe face’s currently loaded glyph slot. has_horizontalHorizontal metrics are present. has_kerningKerning data is present. has_verticalVertical metrics are present. heightThe vertical distance between two consecutive baselines, expressed in font units. is_fixed_widthContains fixed-width (or ‘monospace’) glyphs. is_scalableIs a scalable Face.is_sfntBased on the SFNT storage scheme. max_advance_heightThe maximum advance height, in font units, for all glyphs in this face. max_advance_widthThe maximum advance width, in font units, for all glyphs in this face. num_facesThe number of faces in the font file. num_glyphsThe number of glyphs in the face. sfnt_namesGet a SfntNameslist ofSfntNameentries for the Face.sizeThe currently active size. style_flagsA set of STYLE_FLAGflags indicating the style of the face.style_nameThe face’s style name. tt_headerThe TrueType header ( TT_Header).tt_horiheaderThe TrueType horizontal header ( TT_HoriHeader).tt_os2The OS/2 TrueType header ( TT_OS2).tt_pcltThe PCLT header ( TT_Pclt).tt_postscriptThe Postscript header ( TT_Postscript).tt_vertheaderThe TrueType vertical header ( TT_VertHeader).underline_positionThe position of the underline line, in font units. underline_thicknessThe thickness of the underline, in font units. units_per_emThe number of font units per EM square.