macOS/iOS API解説

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

目次

baselineOffsetInLayoutManager:glyphIndex:

ベースラインオフセット値を返します
-(float)baselineOffsetInLayoutManager:(NSLayoutManager *)layoutMgr:
                    glyphIndex:(unsigned)glyphIndex:

解説

ベースラインオフセット値を返します。

返り値

( float )

浮動小数点値)

引数

( NSLayoutManager * )layoutMgr

レイアウトマネージャー

( unsigned )glyphIndex

グリフ番号

フレームワーク

ApplicationKit

クラス

NSTypesetter

Instance Methods

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
//myOutletはTextView
NSLayoutManager *layM = [[NSLayoutManager alloc] init];
float baseLine;
unsigned glyphIndex = 0;
layM = [myOutlet layoutManager];



baseLine = [[layM typesetter] baselineOffsetInLayoutManager:layM glyphIndex:glyphIndex];


NSLog([NSString stringWithFormat:@"%.2f",baseLine]);
}
@end