Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CGContestSelectFont



When I try to set the font to "Times" with CGContextSelectFont it seems to
fail, because when I subsequently try to measure a 'W' character I get a
zero length.  "Verdana" works fine.  Any ideas?


// This is my font setting code
CGContextSelectFont(ctx, "Times", 100, kCGEncodingMacRoman);

// This is my measuring code
// I am finding Times produces startPt==endPt==(0,0)

CGContextSetTextDrawingMode(fQuartzContext, kCGTextInvisible);

CGPoint startPt = CGContextGetTextPosition(ctx);
CGContextShowText(ctx, &ch, 1);
CGPoint endPt = CGContextGetTextPosition(ctx);

CGContextSetTextDrawingMode(ctx, kCGTextFill);

width = CalcLineLength(startPt, endPt);

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartz-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.