diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c index 8fda112b0..e51dd4a4a 100644 --- a/src/truetype/ttgxvar.c +++ b/src/truetype/ttgxvar.c @@ -1366,8 +1366,12 @@ { FT_Face root = &face->root; - - if ( face->os2.version != 0xFFFFU ) + /* Special case for varying ascender, descender and height: Only modify if + * OS/2 fsSelection's USE_TYPO_METRICS is set. sfnt_load_face uses the hhea + * metics by default, this code would otherwise blindly overwrite those + * metrics with typo or win metrics, leading to a difference in metrics for + * default outlines and all instances. */ + if ( face->os2.version != 0xFFFFU && face->os2.fsSelection & 128 ) { if ( face->os2.sTypoAscender || face->os2.sTypoDescender ) {