drawPackedGlyphs:atPoint:
現在のグラフィックコンテキストのシステム座標で文字を描きます
+ (void)drawPackedGlyphs:(const char *)packedGlyphs atPoint:(NSPoint)aPointclass func drawPackedGlyphs(_ packedGlyphs: UnsafePointer<Int8>, atPoint aPoint: NSPoint)
解説
現在のグラフィックコンテキストのシステム座標において、aPointでpackedGlyphsで文字を描きます。
返り値
なし
引数
グリフ
Objective-C(const char *)packedGlyphspackedGlyphs: UnsafePointer<Int8>
位置
Objective-CatPoint:(NSPoint)aPointatPoint aPoint: NSPoint
フレームワーク
ApplicationKit
クラス
NSBezierPath
使用可能
10.0
参照
appendBezierPathWithGlyph:inFont: - Cocoa API解説(iOS/OS X)
appendBezierPathWithGlyphs:count:inFont: - Cocoa API解説(iOS/OS X)
関連記事(外部サイト)
例文
#import "DrawPath.h" @implementation DrawPath - (IBAction)draw:(id)sender; { NSFont *font =[NSFont fontWithName:@"Osaka" size:36.0]; NSBezierPath *thePath = [NSBezierPath bezierPath]; int ret; NSGlyph glyph= 4546; char packedGlyphs; ret = NSConvertGlyphsToPackedGlyphs(&glyph, 1, NSNativeShortGlyphPacking, &packedGlyphs); NSLog([NSString stringWithFormat:@"%d",ret]); [view lockFocus]; [[NSColor blueColor] set]; [thePath moveToPoint:NSMakePoint(200,200)]; [thePath lineToPoint:NSMakePoint(250,250)]; [thePath appendBezierPathWithGlyph:[font glyphWithName:@"a"] inFont:font ]; [NSBezierPath drawPackedGlyphs:&packedGlyphs atPoint:NSMakePoint(100.0, 100.0)]; [[NSColor redColor] set]; [NSBezierPath drawPackedGlyphs:"bb" atPoint:NSMakePoint(150.0, 150.0)]; [[NSColor blueColor] set]; [thePath stroke]; //[thePath fill]; [view unlockFocus]; } @end
更新時バージョン
10.10