Embed font in a mac bundle
Posted
by RW
on Stack Overflow
See other posts from Stack Overflow
or by RW
Published on 2010-03-15T02:17:10Z
Indexed on
2010/03/15
2:19 UTC
Read the original article
Hit count: 316
I have a program I am writing. I want to use a fancy font. Can I just embed my font into my bundle and use it from there.
My code...
NSMutableAttributedString *recOf; recOf = [[NSMutableAttributedString alloc] initWithString:@"In Recognition of"]; length = [recOf length]; [recOf addAttribute:NSFontAttributeName value:[NSFont fontWithName:@"Edwardian Script ITC" size:50] range:NSMakeRange(0, length)]; [[NSColor blackColor] set]; p.x = (bounds.size.width/2)- (([recOf size].width)/2); p.y = (bounds.size.height/1.7); [recOf drawAtPoint:p]; [recOf release];
© Stack Overflow or respective owner