Skip navigation.
 
mlRe: Cocoa doesn't use my fonts - all fonts are system fonts
FROM : Douglas Davidson
DATE : Fri Aug 04 21:47:09 2006

On Aug 4, 2006, at 11:24 AM, Stefan wrote:

> Now, I tried adding a dictionary using withAttributes: and define its
> properties using
>
> >>>
>    drawDict2 = [NSDictionary dictionaryWithObject:font2 
> forKey:NSFontAttributeName];
> <<<
>
> which immediately succeeded. Not sure, but this feels like a bug. I 
> really wonder,
> why accessing font metrics worked, while drawing the font failed....
>


The string drawing methods (in fact, the entire Cocoa text system) 
always ignore the font set on the context, in favor of their own 
attributes.  If you don't supply an attribute dictionary, a default 
set of attributes will be used.  Use the attribute dictionary, or 
create an attributed string.

Douglas Davidson

Related mailsAuthorDate
mlCocoa doesn't use my fonts - all fonts are system fonts Stefan Aug 4, 20:07
mlRe: Cocoa doesn't use my fonts - all fonts are system fonts Shawn Erickson Aug 4, 20:16
mlRe: Cocoa doesn't use my fonts - all fonts are system fonts Stefan Aug 4, 20:24
mlRe: Cocoa doesn't use my fonts - all fonts are system fonts Douglas Davidson Aug 4, 21:47
mlRe: Cocoa doesn't use my fonts - all fonts are system fonts Stefan Aug 4, 21:53
mlRe: Cocoa doesn't use my fonts - all fonts are system fonts Douglas Davidson Aug 4, 21:59