Re: Drawing text with specifying font
Re: Drawing text with specifying font
- Subject: Re: Drawing text with specifying font
- From: Douglas Davidson <email@hidden>
- Date: Fri, 6 Jul 2001 12:54:16 -0700
On Friday, July 6, 2001, at 10:52 AM, Candide Kemmler wrote:
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.
Perhaps I should consider the dictionary to be provided. But in the
absence of any doc, I just set it to nil.
The dictionary to be supplied here is a standard attribute dictionary,
just like you would find on any attributed string. See the AppKit's
NSAttributedString.h header for a list of the attributes you can set;
the one you want here is NSFontAttributeName. If you want your string
to use more than one font, you can simply create an attributed string
and draw that directly, rather than specifying a string and an attribute
dictionary.
Douglas Davidson