diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 9d4edc267..ecce3c77f 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -459,8 +459,12 @@ hb_color_get_blue hb_color_get_green hb_color_get_red 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 diff --git a/src/dump-emoji.cc b/src/dump-emoji.cc index 63fb5885f..b622da897 100644 --- a/src/dump-emoji.cc +++ b/src/dump-emoji.cc @@ -295,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; { diff --git a/src/hb-ot-color.cc b/src/hb-ot-color.cc index 8150b5e79..fb6ca8660 100644 --- a/src/hb-ot-color.cc +++ b/src/hb-ot-color.cc @@ -57,14 +57,12 @@ _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) @@ -73,7 +71,6 @@ _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) { @@ -87,7 +84,6 @@ _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 /* @@ -253,7 +249,6 @@ hb_ot_color_glyph_get_layers (hb_face_t *face, } -#if 0 /* * SVG */ @@ -264,7 +259,7 @@ hb_ot_color_glyph_get_layers (hb_face_t *face, * * Returns: whether SVG table is available. * - * Since: DONTREPLACEME + * Since: REPLACEME */ hb_bool_t hb_ot_color_has_svg (hb_face_t *face) @@ -279,7 +274,7 @@ hb_ot_color_has_svg (hb_face_t *face) * * Returns: respective svg blob of the glyph, if available. * - * Since: DONTREPLACEME + * Since: REPLACEME */ hb_blob_t * hb_ot_color_glyph_reference_blob_svg (hb_face_t *face, hb_codepoint_t glyph) @@ -298,7 +293,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: DONTREPLACEME + * Since: REPLACEME */ hb_bool_t hb_ot_color_has_png (hb_face_t *face) @@ -317,7 +312,7 @@ hb_ot_color_has_png (hb_face_t *face) * * Returns: respective png blob of the glyph, if available. * - * Since: DONTREPLACEME + * Since: REPLACEME */ hb_blob_t * hb_ot_color_glyph_reference_blob_png (hb_font_t *font, @@ -343,29 +338,3 @@ 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 diff --git a/src/hb-ot-color.h b/src/hb-ot-color.h index 6e4c1777e..a8eae8618 100644 --- a/src/hb-ot-color.h +++ b/src/hb-ot-color.h @@ -111,6 +111,30 @@ 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 */ diff --git a/test/api/test-ot-color.c b/test/api/test-ot-color.c index 27409e10c..51b901d25 100644 --- a/test/api/test-ot-color.c +++ b/test/api/test-ot-color.c @@ -363,7 +363,6 @@ 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); @@ -379,10 +378,8 @@ 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) { @@ -444,7 +441,6 @@ test_hb_ot_color_png (void) hb_blob_destroy (blob); hb_font_destroy (cbdt_font); } -#endif int main (int argc, char **argv) @@ -472,8 +468,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);