*yoffset = ascender;
}
-- (void)drawAtPoint:(CGPoint)point inContext:(CGContextRef)context
-{
- UIGraphicsPushContext(context);
- [_text drawAtPoint:point withFont:_font];
- UIGraphicsPopContext();
-}
-
- (void)drawInContext:(CGContextRef)context atPosition:(CGPoint)position
{
UIGraphicsPushContext(context);
- [_text drawAtPoint:position withFont:_font];
- UIGraphicsPopContext();
+ CGContextSaveGState(context);
+ CGContextScaleCTM(context, 1.0, -1.0);
+ [_text drawAtPoint:CGPointMake(position.x, -position.y - _font.ascender) withFont:_font];
+ CGContextRestoreGState(context);
+ UIGraphicsPopContext();
}
- (void)dealloc
layout =
quartz_new_layout(span->font->name, span->font->size, span->str);
-#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
- CGContextSaveGState(context);
- CGContextScaleCTM(context, 1.0, -1.0);
- p.y = -p.y - span->yoffset_layout;
-#endif
CGContextSetRGBFillColor(context, job->obj->pencolor.u.RGBA[0],
job->obj->pencolor.u.RGBA[1],
job->obj->pencolor.u.RGBA[2],
job->obj->pencolor.u.RGBA[3]);
quartz_draw_layout(layout, context, CGPointMake(p.x, p.y));
-#if __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 20000
- CGContextRestoreGState(context);
-#endif
-
if (span->free_layout != &quartz_free_layout)
quartz_free_layout(layout);
}