提交 26648ceb 编写于 作者: B Behdad Esfahbod

[GX] Remove (partial) support for anisotropic variations

It doesn't always work, not part of FreeType, and we were not going
to expose it in the API anyway.  Can always be added later.
上级 c22176d4
...@@ -110,8 +110,7 @@ struct hb_font_t { ...@@ -110,8 +110,7 @@ struct hb_font_t {
/* Font variation coordinates. */ /* Font variation coordinates. */
unsigned int num_coords; unsigned int num_coords;
int *x_coords; int *coords;
int *y_coords;
hb_font_funcs_t *klass; hb_font_funcs_t *klass;
void *user_data; void *user_data;
......
...@@ -1197,8 +1197,7 @@ hb_font_get_empty (void) ...@@ -1197,8 +1197,7 @@ hb_font_get_empty (void)
0, /* y_ppem */ 0, /* y_ppem */
0, /* num_coords */ 0, /* num_coords */
NULL, /* x_coords */ NULL, /* coords */
NULL, /* y_coords */
const_cast<hb_font_funcs_t *> (&_hb_font_funcs_nil), /* klass */ const_cast<hb_font_funcs_t *> (&_hb_font_funcs_nil), /* klass */
NULL, /* user_data */ NULL, /* user_data */
...@@ -1254,10 +1253,8 @@ hb_font_destroy (hb_font_t *font) ...@@ -1254,10 +1253,8 @@ hb_font_destroy (hb_font_t *font)
hb_face_destroy (font->face); hb_face_destroy (font->face);
hb_font_funcs_destroy (font->klass); hb_font_funcs_destroy (font->klass);
if (font->x_coords) if (font->coords)
free (font->x_coords); free (font->coords);
if (font->y_coords && font->y_coords != font->x_coords)
free (font->y_coords);
free (font); free (font);
} }
...@@ -1564,15 +1561,13 @@ hb_font_set_var_coords_normalized (hb_font_t *font, ...@@ -1564,15 +1561,13 @@ hb_font_set_var_coords_normalized (hb_font_t *font,
if (unlikely (coords_length && !copy)) if (unlikely (coords_length && !copy))
return; return;
if (font->x_coords) if (font->coords)
free (font->x_coords); free (font->coords);
if (font->y_coords && font->y_coords != font->x_coords)
free (font->y_coords);
if (coords_length) if (coords_length)
memcpy (copy, coords, coords_length * sizeof (coords[0])); memcpy (copy, coords, coords_length * sizeof (coords[0]));
font->x_coords = font->y_coords = copy; font->coords = copy;
font->num_coords = coords_length; font->num_coords = coords_length;
} }
......
...@@ -1584,10 +1584,10 @@ struct VariationDevice ...@@ -1584,10 +1584,10 @@ struct VariationDevice
private: private:
inline hb_position_t get_x_delta (hb_font_t *font, const VariationStore &store) const inline hb_position_t get_x_delta (hb_font_t *font, const VariationStore &store) const
{ return font->em_scalef_x (get_delta (store, font->x_coords, font->num_coords)); } { return font->em_scalef_x (get_delta (font, store)); }
inline hb_position_t get_y_delta (hb_font_t *font, const VariationStore &store) const inline hb_position_t get_y_delta (hb_font_t *font, const VariationStore &store) const
{ return font->em_scalef_y (get_delta (store, font->y_coords, font->num_coords)); } { return font->em_scalef_y (get_delta (font, store)); }
inline bool sanitize (hb_sanitize_context_t *c) const inline bool sanitize (hb_sanitize_context_t *c) const
{ {
...@@ -1597,10 +1597,9 @@ struct VariationDevice ...@@ -1597,10 +1597,9 @@ struct VariationDevice
private: private:
inline float get_delta (const VariationStore &store, inline float get_delta (hb_font_t *font, const VariationStore &store) const
int *coords, unsigned int coord_count) const
{ {
return store.get_delta (outerIndex, innerIndex, coords, coord_count); return store.get_delta (outerIndex, innerIndex, font->coords, font->num_coords);
} }
protected: protected:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册