< prev index next >

src/java.desktop/share/native/libfontmanager/harfbuzz/hb-font.cc

Print this page

        

*** 33,44 **** #include "hb-font-private.hh" #include "hb-open-file-private.hh" #include "hb-ot-head-table.hh" #include "hb-ot-maxp-table.hh" - #include "hb-cache-private.hh" - #include <string.h> /* * hb_font_funcs_t --- 33,42 ----
*** 1165,1174 **** --- 1163,1174 ---- font->x_scale = parent->x_scale; font->y_scale = parent->y_scale; font->x_ppem = parent->x_ppem; font->y_ppem = parent->y_ppem; + /* TODO: copy variation coordinates. */ + return font; } /** * hb_font_get_empty:
*** 1194,1203 **** --- 1194,1206 ---- 1000, /* y_scale */ 0, /* x_ppem */ 0, /* y_ppem */ + 0, /* num_coords */ + NULL, /* coords */ + const_cast<hb_font_funcs_t *> (&_hb_font_funcs_nil), /* klass */ NULL, /* user_data */ NULL, /* destroy */ {
*** 1248,1257 **** --- 1251,1262 ---- hb_font_destroy (font->parent); hb_face_destroy (font->face); hb_font_funcs_destroy (font->klass); + free (font->coords); + free (font); } /** * hb_font_set_user_data: (skip)
*** 1537,1546 **** --- 1542,1577 ---- if (x_ppem) *x_ppem = font->x_ppem; if (y_ppem) *y_ppem = font->y_ppem; } + void + hb_font_set_var_coords_normalized (hb_font_t *font, + int *coords, /* XXX 2.14 normalized */ + unsigned int coords_length) + { + if (font->immutable) + return; + + /* Skip tail zero entries. */ + while (coords_length && !coords[coords_length - 1]) + coords_length--; + + int *copy = coords_length ? (int *) calloc (coords_length, sizeof (coords[0])) : NULL; + if (unlikely (coords_length && !copy)) + return; + + free (font->coords); + + if (coords_length) + memcpy (copy, coords, coords_length * sizeof (coords[0])); + + font->coords = copy; + font->num_coords = coords_length; + } + + #ifndef HB_DISABLE_DEPRECATED /* * Deprecated get_glyph_func(): */
< prev index next >