Mailing Lists: Apple Mailing Lists

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

Re: CGContestSelectFont




On Feb 7, 2005, at 11:22 AM, John Kerr wrote:

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);

The font name you pass to CGContextSelectFont is the PostScript name of the font. To use Times you would have to use


CGContextSelectFont(ctx, "Times-Roman", 100, kCGEncodingMacRoman);

Scott

_______________________________________________
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
References: 
 >CGContestSelectFont (From: "John Kerr" <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.