How to use the uharfbuzz.Face.create_for_tables function in uharfbuzz

To help you get started, we’ve selected a few uharfbuzz examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github trufont / trufont / src / trufont / objects / layoutEngine.py View on Github external
def __init__(self, font, tables):
        self._font = font
        self._tables = tables
        upem = font.unitsPerEm

        face = hb.Face.create_for_tables(_get_layout_table, tables)
        face.upem = upem
        font = hb.Font.create(face)
        font.scale = (upem, upem)

        funcs = hb.FontFuncs.create()
        funcs.set_nominal_glyph_func(_get_nominal_glyph, self)
        funcs.set_glyph_h_advance_func(_get_glyph_h_advance, self)
        # TODO: vertical advance
        funcs.set_glyph_name_func(_get_glyph_name_func, self)
        font.funcs = funcs

        self._hbFont = font