开发者

bitmap fonts in cocoa touch

开发者 https://www.devze.com 2023-01-16 01:33 出处:网络
Is it possible to use bitmap fonts in c开发者_开发知识库ocoa touch / quartz 2d? If yes how do I do that?Look at CGContextSelectFont below:

Is it possible to use bitmap fonts in c开发者_开发知识库ocoa touch / quartz 2d? If yes how do I do that?


Look at CGContextSelectFont below:

void MyDrawText (CGContextRef myContext, CGRect contextRect)

{

    float w, h;

    w = contextRect.size.width;

    h = contextRect.size.height;

    CGAffineTransform myTextTransform;

    CGContextSelectFont (myContext, "Helvetica-Bold", h/10, kCGEncodingMacRoman);
    CGContextSetCharacterSpacing (myContext, 10);

    CGContextSetTextDrawingMode (myContext, kCGTextFillStroke);

    CGContextSetRGBFillColor (myContext, 0, 1, 0, .5);

    CGContextSetRGBStrokeColor (myContext, 0, 0, 1, 1);

    myTextTransform =  CGAffineTransformMakeRotation  (MyRadians (45));

    CGContextSetTextMatrix (myContext, myTextTransform);

    CGContextShowTextAtPoint (myContext, 40, 0, "Quartz 2D", 9);

}
0

精彩评论

暂无评论...
验证码 换一张
取 消