NSFont:fontDescriptor
Home 目次>ApplicationKit>NSFont
10.3

fontDescriptor

レシーバのフォントデスクリプタを返します


-(NSFontDescriptor *) fontDescriptor


【返り値】
   NSFontDescriptor *フォントデスクリプタ


【解説】

レシーバのフォントデスクリプタを返します。



【例文】


#import "MyView.h"

//MyView NSView のサブクラス
@implementation MyView

-(
void )drawRect:(NSRect)rect
{
//NSFont *font =[NSFont fontWithName:@"Osaka" size:100.0]; // 普通に作る時はこっち
//NSFont *font =[NSFont fontWithName:@"KozMinPro-Light" size:100.0]; // グリフ ID のマッピングが Osaka とは違う
//NSFont *font =[NSFont fontWithName:@"HiraMinPro-W3" size:100.0]; // グリフ ID のマッピングが Osaka とは違う
NSFontDescriptor *fntDesc = [NSFontDescriptor fontDescriptorWithName: @"Osaka" size: 0 ] ;
NSFont *font =[NSFont fontWithDescriptor:fntDesc size:
100.0 ];

NSLog([fntDesc description]);
NSBezierPath *thePath = [NSBezierPath bezierPath];
NSGlyph glyphID[
8 ] = { 70 , 99 , 106 , 106 , 109 , 2284 , 1064 , 262 };

[thePath moveToPoint:NSMakePoint(
10 , 10 )];
[thePath appendBezierPathWithGlyphs:&glyphID[
0 ]
count:
8
inFont:font
];


[[NSColor blueColor] set];
[thePath fill];

}

@end


(C) 2000-2007 Satoshi Oomori.
[Apple]

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

この記事を評価してください。 

良い 

間違いがある 説明がわかりにくい 例文がわかりにくい  

Home 目次>ApplicationKit>NSFont
修正日2007.4.10