fontWithName:size:
フォントオブジェクトを作って返します
+(NSFont *)fontWithName:(NSString *)fontName: size:(float)fontSize:
解説
フォントオブジェクト(NSFont)を作って返します。
返り値
( NSFont * )
フォント
引数
( NSString * )fontName
フォント名
( float )fontSize
フォントサイズ(point)
フレームワーク
ApplicationKit
クラス
NSFont
Class Methods
使用可能
10.0
参照
- isFlipped (NSView)
例文
#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とは違う NSBezierPath *thePath = [NSBezierPath bezierPath]; NSGlyph glyphID[8]; glyphID[0]=70; glyphID[1]=99; glyphID[2]=106; glyphID[3]=106; glyphID[4]=109; glyphID[5]=2284; glyphID[6]=1064; glyphID[7]=262; [thePath moveToPoint:NSMakePoint(10,10)]; [thePath appendBezierPathWithGlyphs:&glyphID[0] count:8 inFont:font ]; [[NSColor blueColor] set]; [thePath fill]; } @end