Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType
Commits:
-
82c131ac
by Alexei Podtelezhnikov at 2023-02-04T03:20:25+00:00
1 changed file:
Changes:
... | ... | @@ -296,9 +296,13 @@ |
296 | 296 | t1_face->bbox.xMax = ( fi->FontBBox.xMax + 0xFFFF ) >> 16;
|
297 | 297 | t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFF ) >> 16;
|
298 | 298 | |
299 | - /* no `U' suffix here to 0x8000! */
|
|
300 | - t1_face->ascender = (FT_Short)( ( fi->Ascender + 0x8000 ) >> 16 );
|
|
301 | - t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000 ) >> 16 );
|
|
299 | + /* ascender and descender are optional and could both be zero */
|
|
300 | + if ( fi->Ascender || fi->Descender )
|
|
301 | + {
|
|
302 | + /* no `U' suffix here to 0x8000! */
|
|
303 | + t1_face->ascender = (FT_Short)( ( fi->Ascender + 0x8000 ) >> 16 );
|
|
304 | + t1_face->descender = (FT_Short)( ( fi->Descender + 0x8000 ) >> 16 );
|
|
305 | + }
|
|
302 | 306 | |
303 | 307 | if ( fi->NumKernPair )
|
304 | 308 | {
|