set
フォントをセットします
解説
プリント操作やPostScript発行の間、PostScriptのshowやその他のテキスト描画オペレータのレシーバを確定します。
返り値
( void )
なし
引数
フレームワーク
ApplicationKit
クラス
NSFont
Instance Methods
使用可能
10.0
参照
+ useFont:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender {//開けるファイル拡張子の配列 NSAttributedString *aString = [[NSAttributedString alloc] initWithString:@"aaa"]; NSFont *font = [NSFont fontWithName:@"Osaka" size:36]; //フォーカスセット [image lockFocus]; [font set]; //文字列セット [aString drawInRect:[image bounds]]; //フォーカス解除 [image unlockFocus]; } @end