Commit 64591b765710775d95852eecc3981cc1c865bec3

Werner Lemberg 2003-06-01T21:30:04

* include/freetype/fttrigon.h (FT_Vector_Normalize): Removed. * src/type1/t1objs.c (T1_Face_Init): Improve algorithm for guessing the font style by ignoring spaces and hyphens. * builds/unix/freetype2.in: Fix `Version' field.

diff --git a/ChangeLog b/ChangeLog
index 936e90f..ea05487 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2003-05-31  Werner Lemberg  <wl@gnu.org>
+
+	* include/freetype/fttrigon.h (FT_Vector_Normalize): Removed.
+
+2003-05-31    <Ron.Dev@gmx.de>
+
+	* src/type1/t1objs.c (T1_Face_Init): Improve algorithm for guessing
+	the font style by ignoring spaces and hyphens.
+
+	* builds/unix/freetype2.in: Fix `Version' field.
+
 2003-05-30  Werner Lemberg  <wl@gnu.org>
 
 	Avoid overwriting of numeric font dictionary entries for synthetic
diff --git a/builds/unix/freetype2.in b/builds/unix/freetype2.in
index 2b1a6b3..0bc22d1 100644
--- a/builds/unix/freetype2.in
+++ b/builds/unix/freetype2.in
@@ -5,7 +5,7 @@ includedir=@includedir@
 
 Name: FreeType 2
 Description: A free, high-quality, and portable font engine.
-Version: @VERSION@
+Version: @ft_version@
 Requires:
 Libs: -L${libdir} -lfreetype @LIBZ@
 Cflags: -I${includedir}/freetype2
diff --git a/include/freetype/fttrigon.h b/include/freetype/fttrigon.h
index 3b8257b..cf0650e 100644
--- a/include/freetype/fttrigon.h
+++ b/include/freetype/fttrigon.h
@@ -4,7 +4,7 @@
 /*                                                                         */
 /*    FreeType trigonometric functions (specification).                    */
 /*                                                                         */
-/*  Copyright 2001 by                                                      */
+/*  Copyright 2001, 2003 by                                                */
 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
 /*                                                                         */
 /*  This file is part of the FreeType project, and may only be used,       */
@@ -260,22 +260,6 @@ FT_BEGIN_HEADER
   /*************************************************************************/
   /*                                                                       */
   /* @function:                                                            */
-  /*    FT_Vector_Normalize                                                */
-  /*                                                                       */
-  /* @description:                                                         */
-  /*    Normalize a given vector (i.e. compute the equivalent unit         */
-  /*    vector).                                                           */
-  /*                                                                       */
-  /* @inout:                                                               */
-  /*    vec :: The address of target vector.                               */
-  /*                                                                       */
-  FT_EXPORT( void )
-  FT_Vector_Normalize( FT_Vector*  vec );
-
-
-  /*************************************************************************/
-  /*                                                                       */
-  /* @function:                                                            */
   /*    FT_Vector_Polarize                                                 */
   /*                                                                       */
   /* @description:                                                         */
diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c
index 6209e33..6edb96d 100644
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -351,6 +351,8 @@
       /* get style name -- be careful, some broken fonts only */
       /* have a `/FontName' dictionary entry!                 */
       root->family_name = info->family_name;
+      /* assume "Regular" style if we don't know better */
+      root->style_name = (char *)"Regular";
       if ( root->family_name )
       {
         char*  full   = info->full_name;
@@ -359,28 +361,34 @@
 
         if ( full )
         {
-          while ( *family && *full == *family )
+          while ( *full )
           {
-            family++;
-            full++;
+            if ( *full == *family )
+            {
+              family++;
+              full++;
+            }
+            else
+            {
+              if ( *full == ' ' || *full == '-' )
+                full++;
+              else if ( *family == ' ' || *family == '-' )
+                family++;
+              else
+              {
+                if ( !*family )
+                  root->style_name = full;
+                break;
+              }
+            }
           }
-
-          if ( *full == ' ' || *full == '-' )
-            root->style_name = full + 1;
-          else
-            root->style_name = (char *)"Regular";
         }
-        else
-          root->style_name = (char *)"Regular";
       }
       else
       {
         /* do we have a `/FontName'? */
         if ( type1->font_name )
-        {
           root->family_name = type1->font_name;
-          root->style_name  = (char *)"Regular";
-        }
       }
 
       /* compute style flags */