mutable unsigned int upem; /* Units-per-EM. */
mutable unsigned int num_glyphs; /* Number of glyphs. */
- enum dirty_t {
- DIRTY_NOTHING = 0x0000,
- DIRTY_INDEX = 0x0001,
- DIRTY_UPEM = 0x0002,
- DIRTY_NUM_GLYPHS = 0x0004,
- } dirty;
-
struct hb_shaper_data_t shaper_data; /* Various shaper data. */
/* Various non-shaping data. */
HB_INTERNAL void load_num_glyphs (void) const;
};
-HB_MARK_AS_FLAG_T (hb_face_t::dirty_t);
-
extern HB_INTERNAL const hb_face_t _hb_face_nil;
#define HB_SHAPER_DATA_CREATE_FUNC_EXTRA_ARGS
1000, /* upem */
0, /* num_glyphs */
- hb_face_t::DIRTY_NOTHING, /* dirty */
-
{
#define HB_SHAPER_IMPLEMENT(shaper) HB_SHAPER_DATA_INVALID,
#include "hb-shaper-list.hh"
if (face->immutable)
return;
- if (face->index == index)
- return;
-
- face->dirty |= face->DIRTY_INDEX;
-
face->index = index;
}
if (face->immutable)
return;
- if (face->upem == upem)
- return;
-
- face->dirty |= face->DIRTY_UPEM;
-
face->upem = upem;
}
if (face->immutable)
return;
- if (face->num_glyphs == glyph_count)
- return;
-
- face->dirty |= face->DIRTY_NUM_GLYPHS;
-
face->num_glyphs = glyph_count;
}
void *user_data;
hb_destroy_func_t destroy;
- enum dirty_t {
- DIRTY_NOTHING = 0x0000,
- DIRTY_FACE = 0x0001,
- DIRTY_PARENT = 0x0002,
- DIRTY_FUNCS = 0x0004,
- DIRTY_SCALE = 0x0008,
- DIRTY_PPEM = 0x0010,
- DIRTY_PTEM = 0x0020,
- DIRTY_VARIATIONS = 0x0040,
- } 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::DIRTY_NOTHING, /* dirty */
-
{
#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->DIRTY_PARENT;
-
hb_font_t *old = font->parent;
font->parent = hb_font_reference (parent);
if (unlikely (!face))
face = hb_face_get_empty ();
- if (font->face == face)
- return;
-
- font->dirty |= font->DIRTY_FACE;
-
hb_face_t *old = font->face;
font->face = hb_face_reference (face);
if (!klass)
klass = hb_font_funcs_get_empty ();
- font->dirty |= font->DIRTY_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->DIRTY_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->DIRTY_PPEM;
-
font->x_ppem = x_ppem;
font->y_ppem = y_ppem;
}
if (font->immutable)
return;
- if (font->ptem == ptem)
- return;
-
- font->dirty |= font->DIRTY_PTEM;
-
font->ptem = ptem;
}
int *coords, /* 2.14 normalized */
unsigned int coords_length)
{
- if (font->num_coords == coords_length &&
- (coords_length == 0 ||
- 0 == memcmp (font->coords, coords, coords_length * sizeof (coords[0]))))
- {
- free (coords);
- return;
- }
-
- font->dirty |= font->DIRTY_VARIATIONS;
-
free (font->coords);
font->coords = coords;