How to use the uharfbuzz.DrawFuncs 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 harfbuzz / uharfbuzz / tests / test_uharfbuzz.py View on Github external
def test_draw_funcs(self, opensans):
        funcs = hb.DrawFuncs()
        container = []
        def move_to(x,y,c):
            c.append(f"M{x},{y}")
        def line_to(x,y,c):
            c.append(f"L{x},{y}")
        def cubic_to(c1x,c1y,c2x,c2y,x,y,c):
            c.append(f"C{c1x},{c1y} {c2x},{c2y} {x},{y}")
        def quadratic_to(c1x,c1y,x,y,c):
            c.append(f"Q{c1x},{c1y} {x},{y}")
        def close_path(c):
            c.append("Z")

        funcs.set_move_to_func(move_to)
        funcs.set_line_to_func(line_to)
        funcs.set_cubic_to_func(cubic_to)
        funcs.set_quadratic_to_func(quadratic_to)