diff --git a/src/uharfbuzz/_harfbuzz.pyx b/src/uharfbuzz/_harfbuzz.pyx index 7524a62..30fce20 100644 --- a/src/uharfbuzz/_harfbuzz.pyx +++ b/src/uharfbuzz/_harfbuzz.pyx @@ -1593,16 +1593,16 @@ cdef void _paint_push_transform_func( float dx, float dy, void *user_data) noexcept: - f = user_data - f(xx, yx, xy, yy, dx, dy, paint_data) + py_funcs = user_data + py_funcs._push_transform_func(xx, yx, xy, yy, dx, dy, paint_data) cdef void _paint_pop_transform_func( hb_paint_funcs_t *funcs, void *paint_data, void *user_data) noexcept: - f = user_data - f(paint_data) + py_funcs = user_data + py_funcs._pop_transform_func(paint_data) cdef hb_bool_t _paint_color_glyph_func( @@ -1611,9 +1611,9 @@ cdef hb_bool_t _paint_color_glyph_func( hb_codepoint_t glyph, hb_font_t *font, void *user_data) noexcept: - f = user_data + py_funcs = user_data py_font = Font.from_ptr(hb_font_reference(font)) - if f(py_font, glyph, paint_data): + if py_funcs._color_glyph_func(py_font, glyph, paint_data): return 1 return 0 @@ -1624,9 +1624,9 @@ cdef void _paint_push_clip_glyph_func( hb_codepoint_t glyph, hb_font_t *font, void *user_data) noexcept: - f = user_data + py_funcs = user_data py_font = Font.from_ptr(hb_font_reference(font)) - f(py_font, glyph, paint_data) + py_funcs._push_clip_glyph_func(py_font, glyph, paint_data) cdef void _paint_push_clip_rectangle_func( @@ -1637,16 +1637,16 @@ cdef void _paint_push_clip_rectangle_func( float xmax, float ymax, void *user_data) noexcept: - f = user_data - f(xmin, ymin, xmax, ymax, paint_data) + py_funcs = user_data + py_funcs._push_clip_rectangle_func(xmin, ymin, xmax, ymax, paint_data) cdef void _paint_pop_clip_func( hb_paint_funcs_t *funcs, void *paint_data, void *user_data) noexcept: - f = user_data - f(paint_data) + py_funcs = user_data + py_funcs._pop_clip_func(paint_data) cdef void _paint_color_func( @@ -1655,8 +1655,8 @@ cdef void _paint_color_func( hb_bool_t is_foreground, hb_color_t color, void *user_data) noexcept: - f = user_data - f(color, is_foreground, paint_data) + py_funcs = user_data + py_funcs._color_func(color, is_foreground, paint_data) cdef hb_bool_t _paint_image_func( @@ -1669,11 +1669,11 @@ cdef hb_bool_t _paint_image_func( float slant, hb_glyph_extents_t *extents, void *user_data) noexcept: - f = user_data + py_funcs = user_data py_image = Blob.from_ptr(hb_blob_reference(image)) py_format = hb_tag_to_string(format, NULL) py_extents = GlyphExtents(extents.x_bearing, extents.y_bearing, extents.width, extents.height) - if f(py_image, width, height, py_format, slant, py_extents, paint_data): + if py_funcs._image_func(py_image, width, height, py_format, slant, py_extents, paint_data): return 1 return 0 @@ -1689,9 +1689,9 @@ cdef void _paint_linear_gradient_func( float x2, float y2, void *user_data) noexcept: - f = user_data + py_funcs = user_data py_color_line = ColorLine.from_ptr(color_line) - f(py_color_line, x0, y0, x1, y1, x2, y2, paint_data) + py_funcs._linear_gradient_func(py_color_line, x0, y0, x1, y1, x2, y2, paint_data) cdef void _paint_radial_gradient_func( @@ -1705,9 +1705,9 @@ cdef void _paint_radial_gradient_func( float y1, float r1, void *user_data) noexcept: - f = user_data + py_funcs = user_data py_color_line = ColorLine.from_ptr(color_line) - f(py_color_line, x0, y0, r0, x1, y1, r1, paint_data) + py_funcs._radial_gradient_func(py_color_line, x0, y0, r0, x1, y1, r1, paint_data) cdef void _paint_sweep_gradient_func( @@ -1719,17 +1719,17 @@ cdef void _paint_sweep_gradient_func( float start_angle, float end_angle, void *user_data) noexcept: - f = user_data + py_funcs = user_data py_color_line = ColorLine.from_ptr(color_line) - f(py_color_line, x0, y0, start_angle, end_angle, paint_data) + py_funcs._sweep_gradient_func(py_color_line, x0, y0, start_angle, end_angle, paint_data) cdef void _paint_push_group_func( hb_paint_funcs_t *funcs, void *paint_data, void *user_data) noexcept: - f = user_data - f(paint_data) + py_funcs = user_data + py_funcs._push_group_func(paint_data) cdef void _paint_pop_group_func( @@ -1737,9 +1737,9 @@ cdef void _paint_pop_group_func( void *paint_data, hb_paint_composite_mode_t mode, void *user_data) noexcept: - f = user_data + py_funcs = user_data py_mode = PaintCompositeMode(mode) - f(py_mode, paint_data) + py_funcs._pop_group_func(py_mode, paint_data) cdef hb_bool_t _paint_custom_palette_color_func( @@ -1748,8 +1748,8 @@ cdef hb_bool_t _paint_custom_palette_color_func( unsigned int color_index, hb_color_t *color, void *user_data) noexcept: - f = user_data - py_color = f(color_index, paint_data) + py_funcs = user_data + py_color = py_funcs._custom_palette_color_func(color_index, paint_data) if py_color is not None: color[0] = py_color return 1 @@ -1791,7 +1791,7 @@ cdef class PaintFuncs: ], None]) -> None: self._push_transform_func = func hb_paint_funcs_set_push_transform_func( - self._hb_paintfuncs, _paint_push_transform_func, func, NULL) + self._hb_paintfuncs, _paint_push_transform_func, self, NULL) def set_pop_transform_func(self, func: Callable[[ @@ -1799,7 +1799,7 @@ cdef class PaintFuncs: ], None]) -> None: self._pop_transform_func = func hb_paint_funcs_set_pop_transform_func( - self._hb_paintfuncs, _paint_pop_transform_func, func, NULL) + self._hb_paintfuncs, _paint_pop_transform_func, self, NULL) def set_color_glyph_func(self, func: Callable[[ @@ -1809,7 +1809,7 @@ cdef class PaintFuncs: ], bool]) -> None: self._color_glyph_func = func hb_paint_funcs_set_color_glyph_func( - self._hb_paintfuncs, _paint_color_glyph_func, func, NULL) + self._hb_paintfuncs, _paint_color_glyph_func, self, NULL) def set_push_clip_glyph_func(self, func: Callable[[ @@ -1819,7 +1819,7 @@ cdef class PaintFuncs: ], None]) -> None: self._push_clip_glyph_func = func hb_paint_funcs_set_push_clip_glyph_func( - self._hb_paintfuncs, _paint_push_clip_glyph_func, func, NULL) + self._hb_paintfuncs, _paint_push_clip_glyph_func, self, NULL) def set_push_clip_rectangle_func(self, func: Callable[[ @@ -1831,7 +1831,7 @@ cdef class PaintFuncs: ], None]) -> None: self._push_clip_rectangle_func = func hb_paint_funcs_set_push_clip_rectangle_func( - self._hb_paintfuncs, _paint_push_clip_rectangle_func, func, NULL) + self._hb_paintfuncs, _paint_push_clip_rectangle_func, self, NULL) def set_pop_clip_func(self, func: Callable[[ @@ -1839,7 +1839,7 @@ cdef class PaintFuncs: ], None]) -> None: self._pop_clip_func = func hb_paint_funcs_set_pop_clip_func( - self._hb_paintfuncs, _paint_pop_clip_func, func, NULL) + self._hb_paintfuncs, _paint_pop_clip_func, self, NULL) def set_color_func(self, func: Callable[[ @@ -1849,7 +1849,7 @@ cdef class PaintFuncs: ], None]) -> None: self._color_func = func hb_paint_funcs_set_color_func( - self._hb_paintfuncs, _paint_color_func, func, NULL) + self._hb_paintfuncs, _paint_color_func, self, NULL) def set_image_func(self, func: Callable[[ @@ -1863,7 +1863,7 @@ cdef class PaintFuncs: ], bool]) -> None: self._image_func = func hb_paint_funcs_set_image_func( - self._hb_paintfuncs, _paint_image_func, func, NULL) + self._hb_paintfuncs, _paint_image_func, self, NULL) def set_linear_gradient_func(self, func: Callable[[ @@ -1878,7 +1878,7 @@ cdef class PaintFuncs: ], None]) -> None: self._linear_gradient_func = func hb_paint_funcs_set_linear_gradient_func( - self._hb_paintfuncs, _paint_linear_gradient_func, func, NULL) + self._hb_paintfuncs, _paint_linear_gradient_func, self, NULL) def set_radial_gradient_func(self, func: Callable[[ @@ -1893,7 +1893,7 @@ cdef class PaintFuncs: ], None]) -> None: self._radial_gradient_func = func hb_paint_funcs_set_radial_gradient_func( - self._hb_paintfuncs, _paint_radial_gradient_func, func, NULL) + self._hb_paintfuncs, _paint_radial_gradient_func, self, NULL) def set_sweep_gradient_func(self, func: Callable[[ @@ -1906,7 +1906,7 @@ cdef class PaintFuncs: ], None]) -> None: self._sweep_gradient_func = func hb_paint_funcs_set_sweep_gradient_func( - self._hb_paintfuncs, _paint_sweep_gradient_func, func, NULL) + self._hb_paintfuncs, _paint_sweep_gradient_func, self, NULL) def set_push_group_func(self, func: Callable[[ @@ -1914,7 +1914,7 @@ cdef class PaintFuncs: ], None]) -> None: self._push_group_func = func hb_paint_funcs_set_push_group_func( - self._hb_paintfuncs, _paint_push_group_func, func, NULL) + self._hb_paintfuncs, _paint_push_group_func, self, NULL) def set_pop_group_func(self, func: Callable[[ @@ -1923,7 +1923,7 @@ cdef class PaintFuncs: ], None]) -> None: self._pop_group_func = func hb_paint_funcs_set_pop_group_func( - self._hb_paintfuncs, _paint_pop_group_func, func, NULL) + self._hb_paintfuncs, _paint_pop_group_func, self, NULL) def set_custom_palette_color_func(self, func: Callable[[ @@ -1932,7 +1932,7 @@ cdef class PaintFuncs: ], bool]) -> None: self._custom_palette_color_func = func hb_paint_funcs_set_custom_palette_color_func( - self._hb_paintfuncs, _paint_custom_palette_color_func, func, NULL) + self._hb_paintfuncs, _paint_custom_palette_color_func, self, NULL) cdef void _move_to_func(hb_draw_funcs_t *dfuncs,