characterIndexForGlyphAtIndex:
指定したグリフの番号で文字の番号を返します
-(unsigned int)characterIndexForGlyphAtIndex:(unsigned)glyphIndex:
解説
指定したグリフインデックスの位置にあるグリフにマッピングされている最初の文字のNSTextStorageインデックスを返します。
必要な場合にグリフが生成されます。
返り値
( unsigned int )
整数値
引数
( unsigned )glyphIndex
グリフ番号
フレームワーク
ApplicationKit
クラス
NSLayoutManager
Instance Methods
使用可能
10.0
参照
- characterIndexForGlyphAtIndex:
- characterRangeForGlyphRange:actualGlyphRange:
- glyphRangeForCharacterRange:actualCharacterRange:
例文
#import "MyObject.h" @implementation MyObject - (IBAction)myAction:(id)sender { //myOutletはTextView NSLayoutManager *layM1; layM1 = [myOutlet1 layoutManager]; NSLog(@"%u",[layM1 characterIndexForGlyphAtIndex:14212]); } @end