macOS/iOS API解説

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。2010年代に書かれた内容です。今後更新はありません。

目次

NSConvertGlyphsToPackedGlyphs

グリフをパックドグリフに変換します
int  NSConvertGlyphsToPackedGlyphs ( 
      NSGlyph *   glBuf , 
      int   count , 
      NSMultibyteGlyphPacking   packing , 
      char *   packedGlyphs );

解説

グリフをパックドグリフに変換します。

返り値

引数

( NSGlyph * )glBuf
( int )count
( NSMultibyteGlyphPacking )packing
( char * )packedGlyphs

フレームワーク

ApplicationKit

クラス

NSConvertGlyphsToPackedGlyphs

Function

使用可能

10.0

参照

例文

#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