freetypy.FACE_FLAG

class freetypy.FACE_FLAG

Bit flags for important metadata about a Face.

  • SCALABLE: Indicates that the face contains outline glyphs. This doesn’t prevent bitmap strikes, i.e., a face can have both this and and FACE_FLAG.FIXED_SIZES set.

  • FIXED_SIZES: Indicates that the face contains bitmap strikes. See also Face.available_sizes.

  • FIXED_WIDTH: Indicates that the face contains fixed-width characters (like Courier, Lucido, MonoType, etc.).

  • SFNT: Indicates that the face uses the ‘sfnt’ storage scheme. For now, this means TrueType and OpenType.

  • HORIZONTAL: Indicates that the face contains horizontal glyph metrics. This should be set for all common formats.

  • VERTICAL: Indicates that the face contains vertical glyph metrics. This is only available in some formats, not all of them.

  • KERNING: Indicates that the face contains kerning information. If set, the kerning distance can be retrieved through Face.get_kerning. Otherwise the function always returns the vector (0, 0). Note that FreeType doesn’t handle kerning data from the ‘GPOS’ table (as present in some OpenType fonts).

  • MULTIPLE_MASTERS: Indicates that the font contains multiple masters and is capable of interpolating between them. See the multiple-masters specific API for details.

  • GLYPH_NAMES: Indicates that the font contains glyph names that can be retrieved through Face.get_glyph_name. Note that some TrueType fonts contain broken glyph name tables. Use the function Face.has_ps_glyph_names when needed.

  • EXTERNAL_STREAM: Used internally by FreeType to indicate that a face’s stream was provided by the client application and should not be destroyed when the face is destructed. Don’t read or test this flag.

  • HINTER: Set if the font driver has a hinting machine of its own. For example, with TrueType fonts, it makes sense to use data from the SFNT ‘gasp’ table only if the native TrueType hinting engine (with the bytecode interpreter) is available and active.

  • CID_KEYED: Set if the font is CID-keyed. In that case, the font is not accessed by glyph indices but by CID values. For subsetted CID-keyed fonts this has the consequence that not all index values are a valid argument to Face.load_glyph. Only the CID values for which corresponding glyphs in the subsetted font exist make Face.load_glyph return successfully; in all other cases you get a ValueError exception.

    Note that CID-keyed fonts which are in an SFNT wrapper don’t have this flag set since the glyphs are accessed in the normal way (using contiguous indices); the ‘CID-ness’ isn’t visible to the application.

  • TRICKY: Set if the font is ‘tricky’, this is, it always needs the font format’s native hinting engine to get a reasonable result. A typical example is the Chinese font ‘mingli.ttf’ which uses TrueType bytecode instructions to move and scale all of its subglyphs.

    It is not possible to autohint such fonts using LOAD.FORCE_AUTOHINT; it will also ignore LOAD.NO_HINTING. You have to set both LOAD.NO_HINTING and LOAD.NO_AUTOHINT to really disable hinting; however, you probably never want this except for demonstration purposes.

    Currently, there are about a dozen TrueType fonts in the list of tricky fonts; they are hard-coded.

__init__()

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

Attributes

CID_KEYED
EXTERNAL_STREAM
FIXED_SIZES
FIXED_WIDTH
GLYPH_NAMES
HINTER
HORIZONTAL
KERNING
MULTIPLE_MASTERS
SCALABLE
SFNT
TRICKY
VERTICAL