From 8e892bdb544b946e4c1b8705f86baffe67584c54 Mon Sep 17 00:00:00 2001 From: Khaled Hosny Date: Tue, 8 Feb 2022 19:36:29 +0200 Subject: [PATCH] [doc] Message draw documentation a bit --- src/hb-draw.cc | 9 ++++++ src/hb-draw.h | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/hb-font.cc | 2 +- src/hb-font.h | 2 +- 4 files changed, 94 insertions(+), 2 deletions(-) diff --git a/src/hb-draw.cc b/src/hb-draw.cc index 5a43396d9..e83c2678a 100644 --- a/src/hb-draw.cc +++ b/src/hb-draw.cc @@ -28,6 +28,15 @@ #include "hb-draw.hh" +/** + * SECTION:hb-draw + * @title: hb-draw + * @short_description: Glyph drawing + * @include: hb.h + * + * Functions for drawing (extracting) glyph shapes. + **/ + static void hb_draw_move_to_nil (hb_draw_funcs_t *dfuncs HB_UNUSED, void *draw_data HB_UNUSED, hb_draw_state_t *st HB_UNUSED, diff --git a/src/hb-draw.h b/src/hb-draw.h index b8a2746ef..5430ab9e0 100644 --- a/src/hb-draw.h +++ b/src/hb-draw.h @@ -82,25 +82,108 @@ typedef struct hb_draw_state_t { typedef struct hb_draw_funcs_t hb_draw_funcs_t; +/** + * hb_draw_move_to_func_t: + * @dfuncs: draw functions object + * @draw_data: The data accompanying the draw functions + * @st: current draw state + * @to_x: X component of target point + * @to_y: Y component of target point + * @user_data: User data pointer passed by the caller + * + * A virtual method for the #hb_draw_funcs_t to perform a "move-to" draw + * operation. + * + * Since: REPLACEME + * + **/ typedef void (*hb_draw_move_to_func_t) (hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, float to_x, float to_y, void *user_data); + +/** + * hb_draw_line_to_func_t: + * @dfuncs: draw functions object + * @draw_data: The data accompanying the draw functions + * @st: current draw state + * @to_x: X component of target point + * @to_y: Y component of target point + * @user_data: User data pointer passed by the caller + * + * A virtual method for the #hb_draw_funcs_t to perform a "line-to" draw + * operation. + * + * Since: REPLACEME + * + **/ typedef void (*hb_draw_line_to_func_t) (hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, float to_x, float to_y, void *user_data); + +/** + * hb_draw_quadratic_to_func_t: + * @dfuncs: draw functions object + * @draw_data: The data accompanying the draw functions + * @st: current draw state + * @control_x: X component of control point + * @control_y: Y component of control point + * @to_x: X component of target point + * @to_y: Y component of target point + * @user_data: User data pointer passed by the caller + * + * A virtual method for the #hb_draw_funcs_t to perform a "quadratic-to" draw + * operation. + * + * Since: REPLACEME + * + **/ typedef void (*hb_draw_quadratic_to_func_t) (hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, float control_x, float control_y, float to_x, float to_y, void *user_data); + +/** + * hb_draw_cubic_to_func_t: + * @dfuncs: draw functions object + * @draw_data: The data accompanying the draw functions + * @st: current draw state + * @control1_x: X component of first control point + * @control1_y: Y component of first control point + * @control2_x: X component of second control point + * @control2_y: Y component of second control point + * @to_x: X component of target point + * @to_y: Y component of target point + * @user_data: User data pointer passed by the caller + * + * A virtual method for the #hb_draw_funcs_t to perform a "cubic-to" draw + * operation. + * + * Since: REPLACEME + * + **/ typedef void (*hb_draw_cubic_to_func_t) (hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, float control1_x, float control1_y, float control2_x, float control2_y, float to_x, float to_y, void *user_data); + +/** + * hb_draw_close_path_func_t: + * @dfuncs: draw functions object + * @draw_data: The data accompanying the draw functions + * @st: current draw state + * @user_data: User data pointer passed by the caller + * + * A virtual method for the #hb_draw_funcs_t to perform a "close-path" draw + * operation. + * + * Since: REPLACEME + * + **/ typedef void (*hb_draw_close_path_func_t) (hb_draw_funcs_t *dfuncs, void *draw_data, hb_draw_state_t *st, void *user_data); diff --git a/src/hb-font.cc b/src/hb-font.cc index e4e8e898a..7b31d8da4 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -1313,7 +1313,7 @@ hb_font_get_glyph_from_name (hb_font_t *font, * The shape is returned by way of calls to the callsbacks of the @dfuncs * objects, with @draw_data passed to them. * - * Since: REPLACE + * Since: REPLACEME **/ void hb_font_get_glyph_shape (hb_font_t *font, diff --git a/src/hb-font.h b/src/hb-font.h index 188c0ec1a..1126cebfe 100644 --- a/src/hb-font.h +++ b/src/hb-font.h @@ -517,7 +517,7 @@ typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void * * @font_data: @font user data pointer * @glyph: The glyph ID to query * @draw_funcs: The draw functions to send the shape data to - * @draw_data The data accompnaying the draw functions + * @draw_data: The data accompanying the draw functions * @user_data: User data pointer passed by the caller * * A virtual method for the #hb_font_funcs_t of an #hb_font_t object.