macOS/iOS API解説

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

目次

attachmentSizeForGlyphAtIndex:

指定したグリフの番号のテキストアタッチメントのサイズを返します
-(NSSize)attachmentSizeForGlyphAtIndex:(unsigned)glyphIndex:

解説

指定したグリフの番号のテキストアタッチメントのサイズを返します。

返り値

( NSSize )

サイズ

引数

( unsigned )glyphIndex

グリフ番号

フレームワーク

ApplicationKit

クラス

NSLayoutManager

Instance Methods

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
//myOutletはTextView
NSLayoutManager *layM1;
NSSize size;
layM1 = [myOutlet1 layoutManager];
size = [layM1 attachmentSizeForGlyphAtIndex:2];

NSLog([NSString stringWithFormat:@"%.1f,%.1f",size.width,size.height]);
}
@end