| Home 目次>ApplicationKit>NSFont | 10.4 |
textTransform
レシーバーの変換マトリックスを返します
-(NSAffineTransform *) textTransform
【返り値】 | |
| NSAffineTransform * | なし |
【解説】
レシーバーの変換マトリックスを返します。
【例文】
#import "MyView.h"
//MyView は NSView のサブクラス
@implementation MyView
-( void )drawRect:(NSRect)rect
{
NSFont *font = [NSFont fontWithName: @"Osaka" size: 100.0 ];
NSBezierPath *thePath = [NSBezierPath bezierPath];
NSGlyph glyphID[ 8 ];
glyphID[ 0 ]= 70 ;
glyphID[ 1 ]= 99 ;
glyphID[ 2 ]= 106 ;
glyphID[ 3 ]= 106 ;
glyphID[ 4 ]= 109 ;
glyphID[ 5 ]= 2284 ;
glyphID[ 6 ]= 1064 ;
glyphID[ 7 ]= 262 ;
[thePath moveToPoint:NSMakePoint( 10 , 10 )];
[thePath appendBezierPathWithGlyphs:&glyphID[ 0 ]
count: 8
inFont:font
];
[[NSColor blueColor] set];
[thePath fill];
NSAffineTransform *affine = [font textTransform];
NSLog([affine description]);
NSPoint newPoint = [affine transformPoint: NSMakePoint( 20 , 20 )];
NSLog( @"x:%.1f y:%.1f" ,newPoint.x,newPoint.y);
}
@en d
![]() | |
この記事を評価してください。
| Home 目次>ApplicationKit>NSFont | 修正日2007.4.10 |