shithub: freetype+ttf2subf

Download patch

ref: de6523ee05779c4cf3545bf49e297489a57d6142
parent: 803a3fdf89ef4b70ab0e54dde3b71a820fcbab21
author: David Turner <[email protected]>
date: Wed Jun 7 16:05:50 EDT 2000

Added code to correctly scale global metrics

git/fs: mount .git/fs: mount/attach disallowed
--- a/src/cid/cidobjs.c
+++ b/src/cid/cidobjs.c
@@ -101,7 +101,25 @@
   LOCAL_FUNC
   FT_Error  T1_Reset_Size( T1_Size  size )
   {
-    UNUSED(size);
+    /* recompute ascender, descender, etc.. */
+    CID_Face          face    = (CID_Face)size->root.face;
+    FT_Size_Metrics*  metrics = &size->root.metrics;
+
+    if ( metrics->x_ppem < 1 || metrics->y_ppem < 1 )
+      return FT_Err_Invalid_Argument;
+
+    /* Compute root ascender, descender, test height, and max_advance */
+    metrics->ascender = ( FT_MulFix( face->root.ascender,
+                                     metrics->y_scale ) + 32 ) & -64;
+
+    metrics->descender = ( FT_MulFix( face->root.descender,
+                                      metrics->y_scale ) + 32 ) & -64;
+
+    metrics->height = ( FT_MulFix( face->root.height,
+                                   metrics->y_scale ) + 32 ) & -64;
+
+    metrics->max_advance = ( FT_MulFix( face->root.max_advance_width,
+                                        metrics->x_scale ) + 32 ) & -64;
     return 0;
   }