From 4875bb0937a68d9c85fba8f01b81c59bb59bf786 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Wed, 11 Feb 2026 00:42:42 -0700 Subject: [PATCH] [VARC] Set glyph metrics as well --- src/truetype/ttgload.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 962a8e2b3..d509eac9e 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -2580,6 +2580,18 @@ } #endif + { + FT_BBox bbox; + + + FT_Outline_Get_CBox( &glyph->outline, &bbox ); + + glyph->metrics.horiBearingX = bbox.xMin; + glyph->metrics.horiBearingY = bbox.yMax; + glyph->metrics.width = SUB_LONG( bbox.xMax, bbox.xMin ); + glyph->metrics.height = SUB_LONG( bbox.yMax, bbox.yMin ); + } + if ( load_flags & FT_LOAD_NO_SCALE ) { glyph->metrics.horiAdvance = (FT_Pos)advance_width * 64;