NSFont:positionOfGlyph:forCharacter:struckOverRect:
Home 目次>ApplicationKit>NSFont このサイトはこちらに移転しました。

positionOfGlyph:forCharacter:struckOverRect:

指定したグリフが指定した範囲で文字を表す時の位置を返します


-(NSPoint) positionOfGlyph:(NSGlyph)aGlyph
   forCharacter:(unichar)aChar
   struckOverRect:(NSRect)aRect


【返り値】
   NSPointグリフの位置
【パラメータ】
   aGlyphグリフ
   aChar文字
   aRect範囲


【解説】

指定したグリフ(aGluph)が指定した範囲(aRect)で文字(aChar)を表す時の位置を返します。
Mac OS X v10.4 以降使えません。



【例文】


#import "MyObject.h"

@implementation MyObject

- (IBAction)myAction:(id)sender
{
NSFont *fnt;
unichar chr = 'A';
fnt = [NSFont fontWithName:@"Osaka" size:36] ;


NSLog([NSString stringWithFormat:@"%f",[fnt positionOfGlyph:(NSGlyph)'A'
forCharacter:chr
struckOverRect:NSMakeRect(2,2,10,10)
].x]);
}

@end


(C) 2000-2009 Satoshi Oomori.
[Apple]

Google
Webwww.oomori.com
Apple_Store_40x120

[ad:Usual day in Japan]

この記事を評価してください。 

良い 

間違いがある 説明がわかりにくい 例文がわかりにくい  

Home 目次>ApplicationKit>NSFont
修正日2007.4.9