freetype-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Devel] planning next release


From: Dirck Blaskey
Subject: Re: [Devel] planning next release
Date: Tue, 21 Dec 2004 11:47:02 -0800
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

OK, Here's another attempt at the cff / bold detection patch.

As suggested, this puts in the double check
instead of replacing the existing check,
and it also fixes another bug in the previous patch.

--- d:\3rd\freetype2\src\cff\cffobjs.c  Fri May 28 17:52:21 2004
+++ cffobjs.c   Tue Dec 21 19:42:34 2004
@@ -527,10 +527,20 @@
                                                     psnames );
           char*  fullp  = full;
           char*  family = cffface->family_name;
+          char*  family_name = 0;
+
+          if( dict->family_name )
+          {
+            family_name = cff_index_get_sid_string( &cff->string_index,
+                                                    dict->family_name,
+                                                    psnames);
+            if( family_name )
+              family = family_name;
+          }
 
           /* We try to extract the style name from the full name.   */
           /* We need to ignore spaces and dashes during the search. */
-          if ( full )
+          if ( full && family )
           {
             while ( *fullp )
             {
@@ -566,6 +576,8 @@
               }
               break;
             }
+            if( family_name )
+              FT_FREE( family_name );
             FT_FREE( full );
           }
         }
@@ -632,6 +644,12 @@
               flags |= FT_STYLE_FLAG_BOLD;
           FT_FREE( weight );
         }
+
+        /* double check */
+        if ( !(flags && FT_STYLE_FLAG_BOLD) && cffface->style_name )
+          if ( 0==strncmp( cffface->style_name, "Bold", 4  ) ||
+               0==strncmp( cffface->style_name, "Black", 5 ) )
+            flags |= FT_STYLE_FLAG_BOLD;
 
         cffface->style_flags = flags;
       }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]