| 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
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSFont | 修正日2007.4.10 |