Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

static FT_Error FT_GetFileRef_From_Mac_ATS_Name ( const char fontName,
FSRef *  ats_font_ref,
FT_Long face_index 
) [static]

Definition at line 174 of file ftmac.c.

Referenced by FT_GetFile_From_Mac_ATS_Name(), and FT_GetFilePath_From_Mac_ATS_Name().

00177   {
00178     CFStringRef  cf_fontName;
00179     ATSFontRef   ats_font_id;
00180 
00181 
00182     *face_index = 0;
00183 
00184     cf_fontName = CFStringCreateWithCString( NULL, fontName,
00185                                              kCFStringEncodingMacRoman );
00186     ats_font_id = ATSFontFindFromName( cf_fontName,
00187                                        kATSOptionFlagsUnRestrictedScope );
00188     CFRelease( cf_fontName );
00189 
00190     if ( ats_font_id == 0 || ats_font_id == 0xFFFFFFFFUL )
00191       return FT_Err_Unknown_File_Format;
00192 
00193     if ( noErr != FT_ATSFontGetFileReference( ats_font_id, ats_font_ref ) )
00194       return FT_Err_Unknown_File_Format;
00195 
00196     /* face_index calculation by searching preceding fontIDs */
00197     /* with same FSRef                                       */
00198     {
00199       ATSFontRef  id2 = ats_font_id - 1;
00200       FSRef       ref2;
00201 
00202 
00203       while ( id2 > 0 )
00204       {
00205         if ( noErr != FT_ATSFontGetFileReference( id2, &ref2 ) )
00206           break;
00207         if ( noErr != FSCompareFSRefs( ats_font_ref, &ref2 ) )
00208           break;
00209 
00210         id2 --;
00211       }
00212       *face_index = ats_font_id - ( id2 + 1 );
00213     }
00214 
00215     return FT_Err_Ok;
00216   }


Generated on Thu Feb 9 06:09:57 2012 for ReactOS by doxygen 1.6.3

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.