Commit 1bbec9e9939d5f351becd0b01f86a20482749719

Alexei Podtelezhnikov 2023-02-04T08:34:58

* src/type1/t1afm.c (T1_Read_Metrics): Reaffirm ascender and descender.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c
index f558101..787aa92 100644
--- a/src/type1/t1afm.c
+++ b/src/type1/t1afm.c
@@ -297,7 +297,8 @@
       t1_face->bbox.yMax = ( fi->FontBBox.yMax + 0xFFFF ) >> 16;
 
       /* ascender and descender are optional and could both be zero */
-      if ( fi->Ascender || fi->Descender )
+      /* check if values are meaningful before overriding defaults  */
+      if ( fi->Ascender > fi->Descender )
       {  
         /* no `U' suffix here to 0x8000! */
         t1_face->ascender  = (FT_Short)( ( fi->Ascender  + 0x8000 ) >> 16 );