CBDT: Implement paint glyph
This commit is contained in:
parent
82e23f322a
commit
7996ae4c3d
|
@ -28,6 +28,7 @@
|
|||
#define HB_OT_COLOR_CBDT_TABLE_HH
|
||||
|
||||
#include "hb-open-type.hh"
|
||||
#include "hb-paint.hh"
|
||||
|
||||
/*
|
||||
* CBLC -- Color Bitmap Location
|
||||
|
@ -936,6 +937,18 @@ struct CBDT
|
|||
|
||||
bool has_data () const { return cbdt.get_length (); }
|
||||
|
||||
bool paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data) const
|
||||
{
|
||||
hb_blob_t *blob = reference_png (font, glyph);
|
||||
if (unlikely (blob == hb_blob_get_empty ()))
|
||||
return false;
|
||||
|
||||
funcs->image (data, glyph);
|
||||
|
||||
hb_blob_destroy (blob);
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
hb_blob_ptr_t<CBLC> cblc;
|
||||
hb_blob_ptr_t<CBDT> cbdt;
|
||||
|
|
Loading…
Reference in New Issue