shithub: freetype+ttf2subf

Download patch

ref: cd6dcca658f20f37fb224f7b727516d60c442142
parent: d57a5e9fff50751aeb7fe545ef66890084bffab2
author: Werner Lemberg <[email protected]>
date: Thu Jun 19 02:20:21 EDT 2008

* src/type/t1objs.c (T1_Face_Init): Slightly improve algorithm.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2008-06-19  Werner Lemberg  <[email protected]>
+
+	* src/type/t1objs.c (T1_Face_Init): Slightly improve algorithm.
+
 2008-06-18  Werner Lemberg  <[email protected]>
 
 	* src/type/t1objs.c (T1_Face_Init): Fix change from 2008-03-21.
--- a/src/type1/t1objs.c
+++ b/src/type1/t1objs.c
@@ -375,6 +375,9 @@
 
         if ( full )
         {
+          FT_Bool  the_same = TRUE;
+
+
           while ( *full )
           {
             if ( *full == *family )
@@ -390,6 +393,8 @@
                 family++;
               else
               {
+                the_same = FALSE;
+
                 if ( !*family )
                   root->style_name = full;
                 break;
@@ -396,6 +401,9 @@
               }
             }
           }
+
+          if ( the_same )
+            root->style_name = (char *)"Regular";
         }
       }
       else
@@ -410,7 +418,7 @@
         if ( info->weight )
           root->style_name = info->weight;
         else
-          /* assume "Regular" style because we don't know better */
+          /* assume `Regular' style because we don't know better */
           root->style_name = (char *)"Regular";
       }