Re: Drawing text with specifying font
Re: Drawing text with specifying font
- Subject: Re: Drawing text with specifying font
- From: Peter Ammon <email@hidden>
- Date: Fri, 06 Jul 2001 14:12:48 -0700
on 7/6/01 10:52 AM, Candide Kemmler at email@hidden wrote:
>
Hi !
>
>
I'm trying to draw text with various transformations and a font.
>
>
The transformations work, but I can't specify the font.
>
>
I tried [ NSFont set ] (you know what I mean), but when I do
>
>
[NSString drawAtPoint:p withDictionary:nil ],
>
>
the font remains to a default value.
Specify the font in the dictionary. The value is the font you want to use,
the key is NSFontAttributeName.
>
>
Perhaps I should consider the dictionary to be provided. But in the
>
absence of any doc, I just set it to nil.
>
>
Does anyone know how to handle this ?
This page explains the keys and values you can put in the dictionary, and
their effects.
http://developer.apple.com/techpubs/macosx/Cocoa/TasksAndConcepts/Programmin
gTopics/AttributedStrings/Tasks/AccessingAttrs.html
>
>
Candide
>
>
PS: it seems to me that specifying a dictionary at every drawString is a
>
huge overhead...
Then use an NSAttributedString.
-Peter