diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c index 45e52cb94..f55810157 100644 --- a/src/type1/t1afm.c +++ b/src/type1/t1afm.c @@ -296,9 +296,13 @@ t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFF ) >> 16; t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFF ) >> 16; - /* no `U' suffix here to 0x8000! */ - t1_face->ascender = (FT_Short)( ( fi->Ascender + 0x8000 ) >> 16 ); - t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000 ) >> 16 ); + /* ascender and descender are optional and could both be zero */ + if ( fi->Ascender || fi->Descender ) + { + /* no `U' suffix here to 0x8000! */ + t1_face->ascender = (FT_Short)( ( fi->Ascender + 0x8000 ) >> 16 ); + t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000 ) >> 16 ); + } if ( fi->NumKernPair ) {