From 3f9370d9e5051b1abf2fc94be2e10a39c8069f75 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Oct 2017 11:34:53 +0200 Subject: [PATCH] Fix TODO item --- src/hb-font.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/hb-font.cc b/src/hb-font.cc index a684c234d..50da49e74 100644 --- a/src/hb-font.cc +++ b/src/hb-font.cc @@ -1158,7 +1158,18 @@ hb_font_create_sub_font (hb_font_t *parent) font->x_ppem = parent->x_ppem; font->y_ppem = parent->y_ppem; - /* TODO: copy variation coordinates. */ + font->num_coords = parent->num_coords; + if (!font->num_coords) + font->coords = NULL; + else + { + unsigned int size = parent->num_coords * sizeof (parent->coords[0]); + font->coords = (int *) malloc (size); + if (unlikely (!font->coords)) + font->num_coords = 0; + else + memcpy (font->coords, parent->coords, size); + } return font; }