utils

exception fontbakery.utils.BadCertificateSetupException[source][source]
fontbakery.utils.cff_glyph_has_ink(font: fontTools.ttLib.ttFont.TTFont, glyph_name: str) → bool[source][source]
fontbakery.utils.chars_in_range(ttFont, bit)[source][source]
fontbakery.utils.check_bit_entry(ttFont, table, attr, expected, bitmask, bitname)[source][source]
fontbakery.utils.compute_unicoderange_bits(ttFont)[source][source]
fontbakery.utils.download_file(url)[source][source]
fontbakery.utils.filenames_ending_in(suffix, root)[source][source]

Returns a list of the filenames of all files in a given directory subtree that have the given filename suffix. Example: List all “.json” files.

fontbakery.utils.get_DesignerInfoProto_Message(text_data)[source][source]
fontbakery.utils.get_FamilyProto_Message(path)[source][source]
fontbakery.utils.get_Protobuf_Message(klass, path)[source][source]
fontbakery.utils.get_absolute_path(p)[source][source]
fontbakery.utils.get_bounding_box(font)[source][source]

Returns max and min bbox of given truetype font

fontbakery.utils.get_font_glyph_data(font)[source][source]

Return information for each glyph in a font

fontbakery.utils.get_glyph_name(font: fontTools.ttLib.ttFont.TTFont, codepoint: int) → Optional[str][source][source]
fontbakery.utils.get_name_entries(font, nameID, platformID=None, encodingID=None, langID=None)[source][source]
fontbakery.utils.get_name_entry_strings(font, nameID, platformID=None, encodingID=None, langID=None)[source][source]
fontbakery.utils.get_preferred_cmap(ttFont)[source][source]
fontbakery.utils.get_regular(fonts)[source][source]
fontbakery.utils.glyph_contour_count(font, name)[source][source]

Contour count for specified glyph. This implementation will also return contour count for composite glyphs.

fontbakery.utils.glyph_has_ink(font: fontTools.ttLib.ttFont.TTFont, name: str) → bool[source][source]

Checks if specified glyph has any ink.

That is, that it has at least one defined contour associated. Composites are considered to have ink if any of their components have ink. :param font: the font :param glyph_name: The name of the glyph to check for ink.

Returns

True if the font has at least one contour associated with it.

fontbakery.utils.name_entry_id(name)[source][source]
fontbakery.utils.pretty_print_list(values, shorten=10, sep=', ', glue='and')[source][source]
fontbakery.utils.split_camel_case(camelcase)[source][source]
fontbakery.utils.suffix(font)[source][source]
fontbakery.utils.text_flow(content, width=80, indent=0, left_margin=0, space_padding=False, text_color=<built-in method format of str object>)[source][source]
fontbakery.utils.ttf_glyph_has_ink(font: fontTools.ttLib.ttFont.TTFont, name: str) → bool[source][source]
fontbakery.utils.unicoderange_bit_name(bit)[source][source]
fontbakery.utils.unindent_rationale(rationale, checkid=None)[source][source]