GitHub Sale: sign up for any paid plan this week and pay nothing until January 1, 2009!  [ hide ]

public
Description: a tiny graphical app kit for ruby
Homepage: http://code.whytheluckystiff.net/shoes
Clone URL: git://github.com/why/shoes.git
 * shoes/native/cocoa.m: getting custom fonts working on os x, starting 
 with the deprecated API, will add leopard soon.
why (author)
Sun Oct 05 23:43:58 -0700 2008
commit  e685aabb283258e6f47a9b88cd273680c70a59e5
tree    8fc4bfa666a7900d9e3b5535ac556d85f553dd8b
parent  2b9810a05382dd436aa89284f610a73675482849
...
487
488
489
490
 
491
492
493
494
495
 
 
 
 
 
 
 
 
 
 
 
 
 
496
497
498
...
487
488
489
 
490
491
492
 
 
 
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
0
@@ -487,12 +487,22 @@ create_help_menu(NSMenu *main)
0
     [menuHelp release];
0
 }
0
 
0
-int
0
+VALUE
0
 shoes_load_font(const char *filename)
0
 {
0
- ATSFontContainerRef o;
0
- if (ATSFontActivateFromFileReference(file, kATSFontContextLocal, kATSFontFormatUnspecified,
0
- NULL, kATSOptionFlagsDefault, &o) != noErr) return Qnil;
0
+ FSRef fsRef;
0
+ FSSpec fsSpec;
0
+ Boolean isDir;
0
+ FSPathMakeRef(filename, &fsRef, &isDir);
0
+ if (FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL, NULL, &fsSpec, NULL) == noErr)
0
+ {
0
+ ATSFontActivateFromFileSpecification(&fsSpec, kATSFontContextLocal, kATSFontFormatUnspecified,
0
+ NULL, kATSOptionFlagsDefault, NULL);
0
+ }
0
+
0
+ // ATSFontContainerRef o;
0
+ // if (ATSFontActivateFromFileReference(file, kATSFontContextLocal, kATSFontFormatUnspecified,
0
+ // NULL, kATSOptionFlagsDefault, &o) != noErr) return Qnil;
0
   return rb_ary_new();
0
 }
0
 

Comments

    No one has commented yet.