diff --git a/source/texk/web2c/luatexdir/font/tt_glyf.c b/source/texk/web2c/luatexdir/font/tt_glyf.c index 750e126aa..17a72c8e4 100644 --- a/source/texk/web2c/luatexdir/font/tt_glyf.c +++ b/source/texk/web2c/luatexdir/font/tt_glyf.c @@ -163,7 +163,7 @@ int tt_build_tables(sfnt * sfont, struct tt_glyphs *g, fd_entry * fd) int tex_font = fd->tex_font; int streamprovider = 0; int callback_id = 0 ; - if ((tex_font > 0) && (font_streamprovider(tex_font) == 2)) { + if ((tex_font > 0) && (font_streamprovider(tex_font) == 2 || font_streamprovider(tex_font) == 3)) { streamprovider = font_streamprovider(tex_font); callback_id = callback_defined(glyph_stream_provider_callback); } @@ -230,14 +230,23 @@ int tt_build_tables(sfnt * sfont, struct tt_glyphs *g, fd_entry * fd) formatted_error("ttf","invalid glyph index (gid %u)", gid); loc = location[gid]; len = location[gid + 1] - loc; + if (callback_id > 0 && streamprovider == 3) { + int advw, lsb, advh, tsb; + run_callback(callback_id, "dddd->dddd", tex_font, g->gd[i].gid, 3, gid, &advw, &lsb, &advh, &tsb); + g->gd[i].advw = advw; + g->gd[i].lsb = lsb; + g->gd[i].advh = advh; + g->gd[i].tsb = tsb; + } else { - g->gd[i].advw = hmtx[gid].advance; - g->gd[i].lsb = hmtx[gid].sideBearing; - if (vmtx) { - g->gd[i].advh = vmtx[gid].advance; - g->gd[i].tsb = vmtx[gid].sideBearing; - } else { - g->gd[i].advh = g->default_advh; - g->gd[i].tsb = g->default_tsb; - } + g->gd[i].advw = hmtx[gid].advance; + g->gd[i].lsb = hmtx[gid].sideBearing; + if (vmtx) { + g->gd[i].advh = vmtx[gid].advance; + g->gd[i].tsb = vmtx[gid].sideBearing; + } else { + g->gd[i].advh = g->default_advh; + g->gd[i].tsb = g->default_tsb; + } + } g->gd[i].length = len; g->gd[i].data = NULL; @@ -402,7 +411,7 @@ int tt_build_tables(sfnt * sfont, struct tt_glyphs *g, fd_entry * fd) if (callback_id > 0) { lstring * result; long size = 0; - run_callback(callback_id, "ddd->L", tex_font, g->gd[i].gid, streamprovider, &result); + run_callback(callback_id, "ddd->L", tex_font, g->gd[i].gid, 2, &result); padlen = (int) ((result->l % 4) ? (4 - (result->l % 4)) : 0); size = (size_t) result->l + (ULONG) padlen; if (glyf_table_used + size >= glyf_table_size) {