提交 8180c37d 编写于 作者: E Ebrahim Byagowi

[ot-color] Remove _png and _svg public APIs

上级 9aa6279a
......@@ -460,12 +460,8 @@ HB_OT_H_IN
<SECTION>
<FILE>hb-ot-color</FILE>
hb_ot_color_glyph_get_layers
hb_ot_color_glyph_reference_blob_png
hb_ot_color_glyph_reference_blob_svg
hb_ot_color_has_layers
hb_ot_color_has_palettes
hb_ot_color_has_png
hb_ot_color_has_svg
hb_ot_color_layer_t
hb_ot_color_palette_color_get_name_id
hb_ot_color_palette_flags_t
......
......@@ -89,9 +89,12 @@ svg_dump (hb_face_t *face)
{
unsigned glyph_count = hb_face_get_glyph_count (face);
OT::SVG::accelerator_t svg;
svg.init (face);
for (unsigned int glyph_id = 0; glyph_id < glyph_count; glyph_id++)
{
hb_blob_t *blob = hb_ot_color_glyph_reference_blob_svg (face, glyph_id);
hb_blob_t *blob = svg.reference_blob_for_glyph (glyph_id);
if (hb_blob_get_length (blob) == 0) continue;
......@@ -110,6 +113,8 @@ svg_dump (hb_face_t *face)
hb_blob_destroy (blob);
}
svg.fini ();
}
static void
......@@ -290,8 +295,8 @@ main (int argc, char **argv)
sbix_dump (face);
if (hb_ot_color_has_svg (face))
svg_dump (face);
// if (hb_ot_color_has_svg (face))
svg_dump (face);
cairo_font_face_t *cairo_face;
{
......
......@@ -47,12 +47,14 @@ _get_colr (hb_face_t *face)
return *(hb_ot_face_data (face)->COLR.get ());
}
#if 0
static inline const OT::CBDT_accelerator_t&
_get_cbdt (hb_face_t *face)
{
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::CBDT_accelerator_t);
return *(hb_ot_face_data (face)->CBDT.get ());
}
#endif
static inline const OT::CPAL&
_get_cpal (hb_face_t *face)
......@@ -61,6 +63,7 @@ _get_cpal (hb_face_t *face)
return *(hb_ot_face_data (face)->CPAL.get ());
}
#if 0
static inline const OT::sbix_accelerator_t&
_get_sbix (hb_face_t *face)
{
......@@ -74,6 +77,7 @@ _get_svg (hb_face_t *face)
if (unlikely (!hb_ot_shaper_face_data_ensure (face))) return Null(OT::SVG_accelerator_t);
return *(hb_ot_face_data (face)->SVG.get ());
}
#endif
/*
......@@ -239,6 +243,7 @@ hb_ot_color_glyph_get_layers (hb_face_t *face,
}
#if 0
/*
* SVG
*/
......@@ -249,7 +254,7 @@ hb_ot_color_glyph_get_layers (hb_face_t *face,
*
* Returns: whether SVG table is available.
*
* Since: REPLACEME
* Since: DONTREPLACEME
*/
hb_bool_t
hb_ot_color_has_svg (hb_face_t *face)
......@@ -264,7 +269,7 @@ hb_ot_color_has_svg (hb_face_t *face)
*
* Returns: respective svg blob of the glyph, if available.
*
* Since: REPLACEME
* Since: DONTREPLACEME
*/
hb_blob_t *
hb_ot_color_glyph_reference_blob_svg (hb_face_t *face, hb_codepoint_t glyph)
......@@ -283,7 +288,7 @@ hb_ot_color_glyph_reference_blob_svg (hb_face_t *face, hb_codepoint_t glyph)
*
* Returns: whether either of CBDT or sbix tables is available.
*
* Since: REPLACEME
* Since: DONTREPLACEME
*/
hb_bool_t
hb_ot_color_has_png (hb_face_t *face)
......@@ -302,7 +307,7 @@ hb_ot_color_has_png (hb_face_t *face)
*
* Returns: respective png blob of the glyph, if available.
*
* Since: REPLACEME
* Since: DONTREPLACEME
*/
hb_blob_t *
hb_ot_color_glyph_reference_blob_png (hb_font_t *font,
......@@ -328,3 +333,29 @@ hb_ot_color_glyph_reference_blob_png (hb_font_t *font,
return blob;
}
/* To be moved to public header */
/*
* SVG
*/
HB_EXTERN hb_bool_t
hb_ot_color_has_svg (hb_face_t *face);
HB_EXTERN hb_blob_t *
hb_ot_color_glyph_reference_blob_svg (hb_face_t *face, hb_codepoint_t glyph);
/*
* PNG: CBDT or sbix
*/
HB_EXTERN hb_bool_t
hb_ot_color_has_png (hb_face_t *face);
HB_EXTERN hb_blob_t *
hb_ot_color_glyph_reference_blob_png (hb_font_t *font,
hb_codepoint_t glyph,
unsigned int *strike_x_ppem,
unsigned int *strike_y_ppem);
#endif
......@@ -111,30 +111,6 @@ hb_ot_color_glyph_get_layers (hb_face_t *face,
unsigned int *count, /* IN/OUT. May be NULL. */
hb_ot_color_layer_t *layers /* OUT. May be NULL. */);
/*
* SVG
*/
HB_EXTERN hb_bool_t
hb_ot_color_has_svg (hb_face_t *face);
HB_EXTERN hb_blob_t *
hb_ot_color_glyph_reference_blob_svg (hb_face_t *face, hb_codepoint_t glyph);
/*
* PNG: CBDT or sbix
*/
HB_EXTERN hb_bool_t
hb_ot_color_has_png (hb_face_t *face);
HB_EXTERN hb_blob_t *
hb_ot_color_glyph_reference_blob_png (hb_font_t *font,
hb_codepoint_t glyph,
unsigned int *strike_x_ppem,
unsigned int *strike_y_ppem);
HB_END_DECLS
#endif /* HB_OT_COLOR_H */
......@@ -363,6 +363,7 @@ test_hb_ot_color_has_data (void)
g_assert (hb_ot_color_has_palettes (sbix) == FALSE);
g_assert (hb_ot_color_has_palettes (svg) == FALSE);
#if 0
g_assert (hb_ot_color_has_svg (empty) == FALSE);
g_assert (hb_ot_color_has_svg (cpal_v0) == FALSE);
g_assert (hb_ot_color_has_svg (cpal_v1) == FALSE);
......@@ -378,8 +379,10 @@ test_hb_ot_color_has_data (void)
g_assert (hb_ot_color_has_png (cbdt) == TRUE);
g_assert (hb_ot_color_has_png (sbix) == TRUE);
g_assert (hb_ot_color_has_png (svg) == FALSE);
#endif
}
#if 0
static void
test_hb_ot_color_svg (void)
{
......@@ -441,6 +444,7 @@ test_hb_ot_color_png (void)
hb_blob_destroy (blob);
hb_font_destroy (cbdt_font);
}
#endif
int
main (int argc, char **argv)
......@@ -468,8 +472,8 @@ main (int argc, char **argv)
hb_test_add (test_hb_ot_color_palette_color_get_name_id);
hb_test_add (test_hb_ot_color_glyph_get_layers);
hb_test_add (test_hb_ot_color_has_data);
hb_test_add (test_hb_ot_color_png);
hb_test_add (test_hb_ot_color_svg);
// hb_test_add (test_hb_ot_color_png);
// hb_test_add (test_hb_ot_color_svg);
status = hb_test_run();
hb_face_destroy (cpal_v0);
hb_face_destroy (cpal_v1);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册