oops
This commit is contained in:
parent
67308f2ca1
commit
d6c82ba21c
@ -587,7 +587,7 @@ num_codepoints_in_cell(Cell *cell) {
|
|||||||
static inline void
|
static inline void
|
||||||
shape(Cell *first_cell, index_type num_cells, hb_font_t *font) {
|
shape(Cell *first_cell, index_type num_cells, hb_font_t *font) {
|
||||||
if (group_state.groups_capacity <= 2 * num_cells) {
|
if (group_state.groups_capacity <= 2 * num_cells) {
|
||||||
group_state.groups_capacity = MIN(100, 10 * num_cells); // avoid unnecessary reallocs
|
group_state.groups_capacity = MAX(128, 2 * num_cells); // avoid unnecessary reallocs
|
||||||
group_state.groups = realloc(group_state.groups, sizeof(Group) * group_state.groups_capacity);
|
group_state.groups = realloc(group_state.groups, sizeof(Group) * group_state.groups_capacity);
|
||||||
if (!group_state.groups) fatal("Out of memory");
|
if (!group_state.groups) fatal("Out of memory");
|
||||||
}
|
}
|
||||||
@ -791,7 +791,8 @@ render_groups(Font *font) {
|
|||||||
while (idx <= G(group_idx)) {
|
while (idx <= G(group_idx)) {
|
||||||
Group *group = G(groups) + idx;
|
Group *group = G(groups) + idx;
|
||||||
if (!group->num_cells) break;
|
if (!group->num_cells) break;
|
||||||
/* printf("1111111 idx: %u num_cells: %u num_glyphs: %u first_glyph_idx: %u first_cell_idx: %u\n", idx, group->num_cells, group->num_glyphs, group->first_glyph_idx, group->first_cell_idx); */
|
/* printf("Group: idx: %u num_cells: %u num_glyphs: %u first_glyph_idx: %u first_cell_idx: %u total_num_glyphs: %zu\n", */
|
||||||
|
/* idx, group->num_cells, group->num_glyphs, group->first_glyph_idx, group->first_cell_idx, group_state.num_glyphs); */
|
||||||
glyph_index primary = group->num_glyphs ? G(info)[group->first_glyph_idx].codepoint : 0;
|
glyph_index primary = group->num_glyphs ? G(info)[group->first_glyph_idx].codepoint : 0;
|
||||||
for (unsigned i = 1; i < MIN(arraysz(ed.data) + 1, group->num_glyphs); i++) ed.data[i-1] = G(info)[group->first_glyph_idx + i].codepoint;
|
for (unsigned i = 1; i < MIN(arraysz(ed.data) + 1, group->num_glyphs); i++) ed.data[i-1] = G(info)[group->first_glyph_idx + i].codepoint;
|
||||||
render_group(group->num_cells, group->num_glyphs, G(first_cell) + group->first_cell_idx, G(info) + group->first_glyph_idx, G(positions) + group->first_glyph_idx, font, primary, &ed);
|
render_group(group->num_cells, group->num_glyphs, G(first_cell) + group->first_cell_idx, G(info) + group->first_glyph_idx, G(positions) + group->first_glyph_idx, font, primary, &ed);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user