mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-26 01:11:25 +01:00
[font] Actually deprecate get_glyph_shape()
We previously marked it as deprecated in the documentation but didn’t actually deprecate it in code. Now the only known users have migrated to draw_glyph(), lets deprecate o=it for good.
This commit is contained in:
1 parent
c6a01441d9
commit
afe0910295
6 files changed
+57
-50
No files matched your search
@@ -322,6 +322,9 @@ hb_unicode_decompose_compatibility
|
||||
hb_unicode_funcs_set_decompose_compatibility_func
|
||||
HB_UNICODE_COMBINING_CLASS_CCC133
|
||||
hb_font_funcs_set_glyph_v_kerning_func
|
||||
hb_font_get_glyph_shape
|
||||
hb_font_get_glyph_shape_func_t
|
||||
hb_font_funcs_set_glyph_shape_func
|
||||
hb_font_get_glyph_v_kerning
|
||||
hb_font_get_glyph_v_kerning_func_t
|
||||
</SECTION>
|
||||
@@ -406,7 +409,6 @@ hb_font_get_glyph_h_origin
|
||||
hb_font_get_glyph_v_origin
|
||||
hb_font_get_glyph_origin_for_direction
|
||||
hb_font_get_glyph_name
|
||||
hb_font_get_glyph_shape
|
||||
hb_font_draw_glyph
|
||||
hb_font_paint_glyph
|
||||
hb_font_get_nominal_glyph
|
||||
@@ -474,8 +476,6 @@ hb_font_get_glyph_v_origin_func_t
|
||||
hb_font_funcs_set_glyph_v_origin_func
|
||||
hb_font_get_glyph_name_func_t
|
||||
hb_font_funcs_set_glyph_name_func
|
||||
hb_font_get_glyph_shape_func_t
|
||||
hb_font_funcs_set_glyph_shape_func
|
||||
hb_font_draw_glyph_func_t
|
||||
hb_font_funcs_set_draw_glyph_func
|
||||
hb_font_paint_glyph_func_t
|
||||
|
||||
@@ -255,6 +255,52 @@ HB_EXTERN hb_position_t
|
||||
hb_font_get_glyph_v_kerning (hb_font_t *font,
|
||||
hb_codepoint_t top_glyph, hb_codepoint_t bottom_glyph);
|
||||
|
||||
|
||||
/**
|
||||
* hb_font_get_glyph_shape_func_t:
|
||||
* @font: #hb_font_t to work upon
|
||||
* @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 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.
|
||||
*
|
||||
* Since: 4.0.0
|
||||
* Deprecated: 7.0.0: Use #hb_font_draw_glyph_func_t instead
|
||||
**/
|
||||
typedef void (*hb_font_get_glyph_shape_func_t) (hb_font_t *font, void *font_data,
|
||||
hb_codepoint_t glyph,
|
||||
hb_draw_funcs_t *draw_funcs, void *draw_data,
|
||||
void *user_data);
|
||||
|
||||
/**
|
||||
* hb_font_funcs_set_glyph_shape_func:
|
||||
* @ffuncs: A font-function structure
|
||||
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
|
||||
* @user_data: Data to pass to @func
|
||||
* @destroy: (nullable): The function to call when @user_data is not needed anymore
|
||||
*
|
||||
* Sets the implementation function for #hb_font_get_glyph_shape_func_t,
|
||||
* which is the same as #hb_font_draw_glyph_func_t.
|
||||
*
|
||||
* Since: 4.0.0
|
||||
* Deprecated: 7.0.0: Use hb_font_funcs_set_draw_glyph_func() instead
|
||||
**/
|
||||
HB_DEPRECATED_FOR (hb_font_funcs_set_draw_glyph_func)
|
||||
HB_EXTERN void
|
||||
hb_font_funcs_set_glyph_shape_func (hb_font_funcs_t *ffuncs,
|
||||
hb_font_get_glyph_shape_func_t func,
|
||||
void *user_data, hb_destroy_func_t destroy);
|
||||
|
||||
HB_DEPRECATED_FOR (hb_font_draw_glyph)
|
||||
HB_EXTERN void
|
||||
hb_font_get_glyph_shape (hb_font_t *font,
|
||||
hb_codepoint_t glyph,
|
||||
hb_draw_funcs_t *dfuncs, void *draw_data);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -1389,6 +1389,7 @@ hb_font_get_glyph_from_name (hb_font_t *font,
|
||||
return font->get_glyph_from_name (name, len, glyph);
|
||||
}
|
||||
|
||||
#ifndef HB_DISABLE_DEPRECATED
|
||||
/**
|
||||
* hb_font_get_glyph_shape:
|
||||
* @font: #hb_font_t to work upon
|
||||
@@ -1410,6 +1411,7 @@ hb_font_get_glyph_shape (hb_font_t *font,
|
||||
{
|
||||
hb_font_draw_glyph (font, glyph, dfuncs, draw_data);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* hb_font_draw_glyph:
|
||||
@@ -3055,6 +3057,7 @@ hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs,
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef HB_DISABLE_DEPRECATED
|
||||
void
|
||||
hb_font_funcs_set_glyph_shape_func (hb_font_funcs_t *ffuncs,
|
||||
hb_font_get_glyph_shape_func_t func,
|
||||
@@ -3063,3 +3066,4 @@ hb_font_funcs_set_glyph_shape_func (hb_font_funcs_t *ffuncs,
|
||||
{
|
||||
hb_font_funcs_set_draw_glyph_func (ffuncs, func, user_data, destroy);
|
||||
}
|
||||
#endif
|
||||
+1
-44
@@ -485,25 +485,6 @@ typedef hb_bool_t (*hb_font_get_glyph_from_name_func_t) (hb_font_t *font, void *
|
||||
hb_codepoint_t *glyph,
|
||||
void *user_data);
|
||||
|
||||
/**
|
||||
* hb_font_get_glyph_shape_func_t:
|
||||
* @font: #hb_font_t to work upon
|
||||
* @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 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.
|
||||
*
|
||||
* Since: 4.0.0
|
||||
* Deprecated: 7.0.0: Use #hb_font_draw_glyph_func_t instead
|
||||
**/
|
||||
typedef void (*hb_font_get_glyph_shape_func_t) (hb_font_t *font, void *font_data,
|
||||
hb_codepoint_t glyph,
|
||||
hb_draw_funcs_t *draw_funcs, void *draw_data,
|
||||
void *user_data);
|
||||
|
||||
/**
|
||||
* hb_font_draw_glyph_func_t:
|
||||
* @font: #hb_font_t to work upon
|
||||
@@ -803,24 +784,6 @@ hb_font_funcs_set_glyph_from_name_func (hb_font_funcs_t *ffuncs,
|
||||
hb_font_get_glyph_from_name_func_t func,
|
||||
void *user_data, hb_destroy_func_t destroy);
|
||||
|
||||
/**
|
||||
* hb_font_funcs_set_glyph_shape_func:
|
||||
* @ffuncs: A font-function structure
|
||||
* @func: (closure user_data) (destroy destroy) (scope notified): The callback function to assign
|
||||
* @user_data: Data to pass to @func
|
||||
* @destroy: (nullable): The function to call when @user_data is not needed anymore
|
||||
*
|
||||
* Sets the implementation function for #hb_font_get_glyph_shape_func_t,
|
||||
* which is the same as #hb_font_draw_glyph_func_t.
|
||||
*
|
||||
* Since: 4.0.0
|
||||
* Deprecated: 7.0.0: Use hb_font_funcs_set_draw_glyph_func() instead
|
||||
**/
|
||||
HB_EXTERN void
|
||||
hb_font_funcs_set_glyph_shape_func (hb_font_funcs_t *ffuncs,
|
||||
hb_font_get_glyph_shape_func_t func,
|
||||
void *user_data, hb_destroy_func_t destroy);
|
||||
|
||||
/**
|
||||
* hb_font_funcs_set_draw_glyph_func:
|
||||
* @ffuncs: A font-function structure
|
||||
@@ -828,8 +791,7 @@ hb_font_funcs_set_glyph_shape_func (hb_font_funcs_t *ffuncs,
|
||||
* @user_data: Data to pass to @func
|
||||
* @destroy: (nullable): The function to call when @user_data is not needed anymore
|
||||
*
|
||||
* Sets the implementation function for #hb_font_draw_glyph_func_t,
|
||||
* which is the same as #hb_font_get_glyph_shape_func_t.
|
||||
* Sets the implementation function for #hb_font_draw_glyph_func_t.
|
||||
*
|
||||
* Since: 7.0.0
|
||||
**/
|
||||
@@ -934,11 +896,6 @@ hb_font_get_glyph_from_name (hb_font_t *font,
|
||||
const char *name, int len, /* -1 means nul-terminated */
|
||||
hb_codepoint_t *glyph);
|
||||
|
||||
HB_EXTERN void
|
||||
hb_font_get_glyph_shape (hb_font_t *font,
|
||||
hb_codepoint_t glyph,
|
||||
hb_draw_funcs_t *dfuncs, void *draw_data);
|
||||
|
||||
HB_EXTERN void
|
||||
hb_font_draw_glyph (hb_font_t *font,
|
||||
hb_codepoint_t glyph,
|
||||
|
||||
+2
-2
@@ -245,7 +245,7 @@ layered_glyph_dump (hb_font_t *font, hb_draw_funcs_t *funcs, unsigned face_index
|
||||
if (hb_color_get_alpha (color) != 255)
|
||||
fprintf (f, "fill-opacity=\"%.3f\"", (double) hb_color_get_alpha (color) / 255.);
|
||||
fprintf (f, "d=\"");
|
||||
hb_font_get_glyph_shape (font, layers[layer].glyph, funcs, &draw_data);
|
||||
hb_font_draw_glyph (font, layers[layer].glyph, funcs, &draw_data);
|
||||
fprintf (f, "\"/>\n");
|
||||
}
|
||||
|
||||
@@ -284,7 +284,7 @@ dump_glyphs (hb_font_t *font, hb_draw_funcs_t *funcs, unsigned face_index)
|
||||
draw_data_t draw_data;
|
||||
draw_data.ascender = font_extents.ascender;
|
||||
draw_data.f = f;
|
||||
hb_font_get_glyph_shape (font, gid, funcs, &draw_data);
|
||||
hb_font_draw_glyph (font, gid, funcs, &draw_data);
|
||||
fprintf (f, "\"/></svg>");
|
||||
fclose (f);
|
||||
}
|
||||
|
||||
@@ -188,7 +188,7 @@ test_font (hb_font_t *font, hb_codepoint_t cp)
|
||||
hb_ot_var_normalize_coords (face, 0, NULL, NULL);
|
||||
|
||||
hb_draw_funcs_t *funcs = hb_draw_funcs_create ();
|
||||
hb_font_get_glyph_shape (font, cp, funcs, NULL);
|
||||
hb_font_draw_glyph (font, cp, funcs, NULL);
|
||||
hb_draw_funcs_destroy (funcs);
|
||||
|
||||
hb_set_destroy (set);
|
||||
|
||||
Reference in new issue
Block a user