Paul Miller | 6 Dec 2002 18:41

Freetype 2.1.3 Mac bugs

Updated to 2.1.3 (from 2.0.8) and found some Mac bugs. One has crept in 
since 2.0.8, and one has been there for a long time.

1. file_spec_from_path() for TARGET_API_MAC_CARBON is broken.

	FSPathMakeRef() takes a pascal string (as most, if not all, Mac path 
functions do), but a C string is passed to it. So it always fails.

The NON-carbon code there works for both cases, so the 
TARGET_API_MAX_CARBON code should be removed. The new function should just be:

   /* Given a pathname, fill in a file spec. */
   static int
   file_spec_from_path( const char*  pathname,
                        FSSpec*      spec )
   {
     Str255    p_path;
     FT_ULong  path_len;

     /* convert path to a pascal string */
     path_len = ft_strlen( pathname );
     if ( path_len > 255 )
       return -1;
     p_path[0] = (unsigned char)path_len;
     ft_strncpy( (char*)p_path + 1, pathname, path_len );

     if ( FSMakeFSSpec( 0, 0, p_path, spec ) != noErr )
       return -1;
     else
       return 0;
   }

2. multi-resource .dfont files dont seem to work. If I try to load the 
second or third FOND from a dfont file (like Helvetica.dfont, etc) to get 
the Bold or Italic versions, it doesn't work for some reason. I'm looking 
into this now.

Gmane