小编RW.*_*RW.的帖子

在mac包中嵌入字体

我有一个我写的程序.我想用一种花哨的字体.我可以将我的字体嵌入到我的包中并从那里使用它.

我的代码......

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];
Run Code Online (Sandbox Code Playgroud)

xcode fonts cocoa objective-c nsview

38
推荐指数
2
解决办法
8674
查看次数

标签 统计

cocoa ×1

fonts ×1

nsview ×1

objective-c ×1

xcode ×1