shithub: freetype+ttf2subf

Download patch

ref: d233482ef5b2988b31eeff2cc11eb7825f972915
parent: 95867077e8f03476359f313a92013afe73d93ebf
author: Werner Lemberg <[email protected]>
date: Fri Feb 13 18:48:39 EST 2004

* src/base/ftobjs.c (FT_Set_Char_Size): Return immediately if
ppem values don't change.  Suggested by Graham Asher.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-02-12  Werner Lemberg  <[email protected]>
+
+	* src/base/ftobjs.c (FT_Set_Char_Size): Return immediately if
+	ppem values don't change.  Suggested by Graham Asher.
+
 2004-02-11  Werner Lemberg  <[email protected]>
 
 	* src/cid/cidload.c (cid_face_open): Always allocate
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -2042,8 +2042,17 @@
     dim_x = ( char_width  * horz_resolution + 36 ) / 72;
     dim_y = ( char_height * vert_resolution + 36 ) / 72;
 
-    metrics->x_ppem  = (FT_UShort)( ( dim_x + 32 ) >> 6 );
-    metrics->y_ppem  = (FT_UShort)( ( dim_y + 32 ) >> 6 );
+    {
+      FT_UShort  x_ppem = (FT_UShort)( ( dim_x + 32 ) >> 6 );
+      FT_UShort  y_ppem = (FT_UShort)( ( dim_y + 32 ) >> 6 );
+
+
+      if ( x_ppem == metrics->x_ppem && y_ppem == metrics->y_ppem )
+        return
+
+      metrics->x_ppem = x_ppem;
+      metrics->y_ppem = y_ppem;
+    }
 
     metrics->x_scale = 0x10000L;
     metrics->y_scale = 0x10000L;
--- a/src/cache/ftcsbits.c
+++ b/src/cache/ftcsbits.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType sbits manager (body).                                       */
 /*                                                                         */
-/*  Copyright 2000-2001, 2002, 2003 by                                     */
+/*  Copyright 2000-2001, 2002, 2003, 2004 by                               */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -119,7 +119,7 @@
         goto BadGlyph;
       }
 
-      /* +      /* Check that our values fit into 8-bit containers!       */
       /* If this is not the case, our bitmap is too large       */
       /* and we will leave it as `missing' with sbit.buffer = 0 */