void *user_data;
hb_destroy_func_t destroy;
+ enum dirty_t {
+ NOTHING = 0x0000,
+ FACE = 0x0001,
+ PARENT = 0x0002,
+ FUNCS = 0x0004,
+ SCALE = 0x0008,
+ PPEM = 0x0010,
+ VARIATIONS = 0x0020,
+ } dirty;
+
struct hb_shaper_data_t shaper_data;
}
};
+HB_MARK_AS_FLAG_T (hb_font_t::dirty_t);
+
#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_PROTOTYPE(shaper, font);
#include "hb-shaper-list.hh"
NULL, /* user_data */
NULL, /* destroy */
+ hb_font_t::NOTHING, /* dirty_bits */
+
{
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
#include "hb-shaper-list.hh"
if (!parent)
parent = hb_font_get_empty ();
+ if (parent == font->parent)
+ return;
+
+ font->dirty |= font->PARENT;
+
hb_font_t *old = font->parent;
font->parent = hb_font_reference (parent);
if (font->face == face)
return;
+ font->dirty |= font->FACE;
+
hb_face_t *old = font->face;
font->face = hb_face_reference (face);
if (!klass)
klass = hb_font_funcs_get_empty ();
+ font->dirty |= font->FUNCS;
+
hb_font_funcs_reference (klass);
hb_font_funcs_destroy (font->klass);
font->klass = klass;
if (font->immutable)
return;
+ if (font->x_scale == x_scale && font->y_scale == y_scale)
+ return;
+
+ font->dirty |= font->SCALE;
+
font->x_scale = x_scale;
font->y_scale = y_scale;
}
if (font->immutable)
return;
+ if (font->x_ppem == x_ppem && font->y_ppem == y_ppem)
+ return;
+
+ font->dirty |= font->PPEM;
+
font->x_ppem = x_ppem;
font->y_ppem = y_ppem;
}
int *coords, /* 2.14 normalized */
unsigned int coords_length)
{
+ if (font->num_coords == coords_length &&
+ 0 == memcmp (font->coords, coords, coords_length * sizeof (coords[0])))
+ {
+ free (coords);
+ return;
+ }
+
+ font->dirty |= font->VARIATIONS;
+
free (font->coords);
font->coords = coords;