shithub: freetype+ttf2subf

Download patch

ref: c70818a86218ba0b322102147d27de1b52b9db05
parent: 6eb116ef8ac266d40d05cbac263ae9a951c30caa
author: Werner Lemberg <[email protected]>
date: Thu May 15 02:44:09 EDT 2003

* src/base/ftmac.c (FT_New_Face_From_SFNT): Handle CFF files also.

* include/freetype/freetype.h: Fix typo in comment
(FT_HAS_FIXED_SIZES).

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2003-05-14  George Williams  <[email protected]>
+
+	* src/base/ftmac.c (FT_New_Face_From_SFNT): Handle CFF files also.
+
+2003-05-14  Werner Lemberg  <[email protected]>
+
+	* include/freetype/freetype.h: Fix typo in comment
+	(FT_HAS_FIXED_SIZES).
+
 2003-05-10  Dan Williams  <[email protected]>
 
 	* builds/unix/aclocal.m4: Comment out definition of
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -1016,7 +1016,7 @@
   /*************************************************************************/
   /*                                                                       */
   /* @macro:                                                               */
-  /*    FT_IS_FIXED_SIZES( face )                                          */
+  /*    FT_HAS_FIXED_SIZES( face )                                         */
   /*                                                                       */
   /* @description:                                                         */
   /*    A macro that returns true whenever a face object contains some     */
--- a/src/base/ftbbox.c
+++ b/src/base/ftbbox.c
@@ -98,9 +98,9 @@
   static void
   BBox_Conic_Check( FT_Pos   y1,
                     FT_Pos   y2,
-                          FT_Pos   y3,
-                          FT_Pos*  min,
-                          FT_Pos*  max )
+                    FT_Pos   y3,
+                    FT_Pos*  min,
+                    FT_Pos*  max )
   {
     if ( y1 <= y3 )
     {
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -588,6 +588,7 @@
     size_t     sfnt_size;
     FT_Error   error = 0;
     FT_Memory  memory = library->memory;
+    int        is_cff;
 
 
     sfnt = GetResource( 'sfnt', sfnt_id );
@@ -606,11 +607,16 @@
     HUnlock( sfnt );
     ReleaseResource( sfnt );
 
+    is_cff = rlen > 4 && sfnt_data[0] == 'O' &&
+                         sfnt_data[1] == 'T' &&
+                         sfnt_data[2] == 'T' &&
+                         sfnt_data[3] == 'O';
+
     return open_face_from_buffer( library,
                                   sfnt_data,
                                   sfnt_size,
                                   face_index,
-                                  "truetype",
+                                  is_cff ? "cff" : "truetype",
                                   aface );
   }
 
--- a/src/base/fttrigon.c
+++ b/src/base/fttrigon.c
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType trigonometric functions (body).                             */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2002, 2003 by                                          */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -366,8 +366,8 @@
     FT_Vector  v;
 
 
-    v.x   = vec->x;
-    v.y   = vec->y;
+    v.x = vec->x;
+    v.y = vec->y;
 
     if ( angle && ( v.x != 0 || v.y != 0 ) )
     {