always use __mg_glyph_string_set_size

This commit is contained in:
Vincent Wei
2019-04-10 09:16:41 +08:00
parent a36b2fb3b3
commit 33bd6087b5
2 changed files with 10 additions and 0 deletions
+5
View File
@@ -154,6 +154,7 @@ static BOOL shape_layout_run(SEInstance* inst,
}
// generate the glyphs
#if 0
gs->glyphs = malloc(sizeof(ShapedGlyph) * nr_ucs);
if (gs->glyphs == NULL) {
goto out;
@@ -163,6 +164,10 @@ static BOOL shape_layout_run(SEInstance* inst,
free(gs->glyphs);
goto out;
}
#else
// must use __mg_glyph_string_set_size
__mg_glyph_string_set_size(gs, nr_ucs);
#endif
j = 0;
for (i = 0; i < nr_ucs; i++) {
+5
View File
@@ -245,6 +245,7 @@ static BOOL shape_layout_run(SEInstance* inst,
}
// generate result
#if 0
assert(gs->glyphs == NULL);
assert(gs->log_clusters == NULL);
@@ -257,6 +258,10 @@ static BOOL shape_layout_run(SEInstance* inst,
free(gs->glyphs);
goto error;
}
#else
// must use __mg_glyph_string_set_size
__mg_glyph_string_set_size(gs, nr_glyphs);
#endif
last_cluster = -1;
gs->nr_glyphs = nr_glyphs;