cff2: Implement paint_glyph
This commit is contained in:
parent
df89b52130
commit
3e39dd492b
|
@ -143,6 +143,27 @@ bool OT::cff2::accelerator_t::get_extents (hb_font_t *font,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool OT::cff2::accelerator_t::paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data) const
|
||||
{
|
||||
int xscale, yscale;
|
||||
unsigned int upem;
|
||||
|
||||
hb_font_get_scale (font, &xscale, &yscale);
|
||||
upem = hb_face_get_upem (hb_font_get_face (font));
|
||||
|
||||
funcs->push_transform (data, xscale/(float)upem, 0,
|
||||
0, yscale/(float)upem,
|
||||
0, 0);
|
||||
|
||||
funcs->push_clip_glyph (data, glyph);
|
||||
funcs->color (data, 0xffff, 1.);
|
||||
funcs->pop_clip (data);
|
||||
|
||||
funcs->pop_transform (data);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
struct cff2_path_param_t
|
||||
{
|
||||
cff2_path_param_t (hb_font_t *font_, hb_draw_session_t &draw_session_)
|
||||
|
|
|
@ -30,6 +30,7 @@
|
|||
#include "hb-ot-cff-common.hh"
|
||||
#include "hb-subset-cff2.hh"
|
||||
#include "hb-draw.hh"
|
||||
#include "hb-paint.hh"
|
||||
|
||||
namespace CFF {
|
||||
|
||||
|
@ -516,6 +517,7 @@ struct cff2
|
|||
HB_INTERNAL bool get_extents (hb_font_t *font,
|
||||
hb_codepoint_t glyph,
|
||||
hb_glyph_extents_t *extents) const;
|
||||
HB_INTERNAL bool paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data) const;
|
||||
HB_INTERNAL bool get_path (hb_font_t *font, hb_codepoint_t glyph, hb_draw_session_t &draw_session) const;
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue