Cocoa API解説(macOS/iOS)

iOS , Mac アプリケーション開発のために使われる主要フレームワークの日本語情報です。

目次

getGlyphsInRange:glyphs:characterIndexes:glyphInscriptions:elasticBits:

グリフの情報を参照で返します
-(unsigned int)getGlyphsInRange:(NSRange)glyphsRange:
          glyphs:(NSGlyph *)glyphBuffer:
          characterIndexes:(unsigned *)charIndexBuffer:
          glyphInscriptions:(NSGlyphInscription *)inscribeBuffer:
          elasticBits:(BOOL *)elasticBuffer:

解説

グリフの情報を参照で返します。
【NSGlyphInscription】
● NSGlyphInscribeBase
● NSGlyphInscribeBelow
● NSGlyphInscribeAbove
● NSGlyphInscribeOverstrike
● NSGlyphInscribeOverBelow

返り値

( unsigned int )

整数値

引数

( NSRange )glyphsRange

グリフ範囲

( NSGlyph * )glyphBuffer

グリフの配列

( unsigned * )charIndexBuffer

文字の順番の番号

( NSGlyphInscription * )inscribeBuffer

前のグリフとの配置方法

( BOOL * )elasticBuffer

フレームワーク

ApplicationKit

クラス

NSLayoutManager

Instance Methods

使用可能

10.0

参照

例文

#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
	//myOutletはTextView
	int i;
	NSLayoutManager *layM1;
	NSGlyph gly[10];
	unsigned int charIndexBuffer[10];
	NSGlyphInscription inscribeBuffer[10];
	BOOL elasticBuffer[10];

	layM1 = [myOutlet1 layoutManager];

	[layM1 getGlyphsInRange:NSMakeRange(0,4)
				glyphs:		&gly[0]
				characterIndexes:	&charIndexBuffer[0]
				glyphInscriptions:	&inscribeBuffer[0]
				elasticBits:	&elasticBuffer[0]
				];
	for( i=0 ; i<4 ; i++ ){
	NSLog(@"%u,%u,%u,%u",gly[i],charIndexBuffer[i],inscribeBuffer[i],elasticBuffer[i]);
	switch (inscribeBuffer[i]){
		case NSGlyphInscribeBase:
			NSLog(@"NSGlyphInscribeBase");
			break;
		case NSGlyphInscribeBelow:
			NSLog(@"NSGlyphInscribeBelow");
			break;
		case NSGlyphInscribeAbove:
			NSLog(@"NSGlyphInscribeAbove");
			break;
		case NSGlyphInscribeOverstrike:
			NSLog(@"NSGlyphInscribeOverstrike");
			break;
		case NSGlyphInscribeOverBelow:
			NSLog(@"NSGlyphInscribeOverBelow");
			break;
		default:
			NSLog(@"default");
			break;
			}
	}


}
@end