Skip navigation.
 
mlRe: Cocoa doesn't use my fonts - all fonts are system fonts
FROM : Shawn Erickson
DATE : Fri Aug 04 20:16:33 2006

On 8/4/06, Stefan <seaside.<email_removed>> wrote:
> I created a NSView subclass and use
>
>  >>
> NSFont* font1= [NSFont fontWithName:@"Times-Roman" size:20.0];
> <<
>
> to create a font. Then, during (void)drawRect:(NSRect)rect, I set the
> font using
>
>  >>>
> [font1 set];
> <<<
>
> I get the correct line line-height of the font, but all fonts appear
> on screen
> and on print as system fonts of default size.


Can you outline what you are drawing in your drawRect: and how you are
drawing it?

With that said I have a feeling that you may not be retaining the font
you create correctly based on the code you have so far listed (however
I would expect a crash not a silent failure).

-Shawn

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