首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ios自定义标签不支持字体系列只支持Lucida Grande?

ios自定义标签不支持字体系列只支持Lucida Grande?
EN

Stack Overflow用户
提问于 2013-02-28 13:45:57
回答 1查看 423关注 0票数 0

我正在使用Lucida Grande字体系列,它工作得很好。

代码语言:javascript
复制
FontLabel *label4 = [[FontLabel alloc] initWithFrame:CGRectMake(10, 6, 250, 50)];
        ZMutableAttributedString *str = [[ZMutableAttributedString alloc] initWithString:cmd_string
                                                                              attributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                                                          [[FontManager sharedManager] zFontWithName:@"Lucida Grande" pointSize:12],
                                                                                          ZFontAttributeName,
                                                                                          nil]];
        label4.backgroundColor=[UIColor clearColor];
        [str addAttribute:ZFontAttributeName value:[[FontManager sharedManager] zFontWithName:@"Lucida Grande" pointSize:12] range:NSMakeRange(0, name_length)];
        [str addAttribute:ZForegroundColorAttributeName value:[UIColor colorWithRed:241/255.0f green:73.0/255.0f blue:2.0/255.0f alpha:1.0]range:NSMakeRange(0, name_length)];
        [str addAttribute:ZForegroundColorAttributeName value:[UIColor colorWithRed:128.0/255.0f green:121.0/255.0f blue:98.0/255.0f alpha:1.0]range:NSMakeRange(name_length, cmd_str_len-name_length)];
        label4.zAttributedText = str;
        label4.numberOfLines=0;
        [label4 sizeToFit];

我正在使用Helvetica-Bold字体家族,它不能工作的应用程序抓取,请帮助我。

代码语言:javascript
复制
FontLabel *label4 = [[FontLabel alloc] initWithFrame:CGRectMake(10, 6, 250, 50)];
        ZMutableAttributedString *str = [[ZMutableAttributedString alloc] initWithString:cmd_string
                                                                              attributes:[NSDictionary dictionaryWithObjectsAndKeys:
                                                                                          [[FontManager sharedManager] zFontWithName:@"Helvetica-Bold" pointSize:12],
                                                                                          ZFontAttributeName,
                                                                                          nil]];
        label4.backgroundColor=[UIColor clearColor];
        [str addAttribute:ZFontAttributeName value:[[FontManager sharedManager] zFontWithName:@"Helvetica-Bold" pointSize:12] range:NSMakeRange(0, name_length)];
        [str addAttribute:ZForegroundColorAttributeName value:[UIColor colorWithRed:241/255.0f green:73.0/255.0f blue:2.0/255.0f alpha:1.0]range:NSMakeRange(0, name_length)];
        [str addAttribute:ZForegroundColorAttributeName value:[UIColor colorWithRed:128.0/255.0f green:121.0/255.0f blue:98.0/255.0f alpha:1.0]range:NSMakeRange(name_length, cmd_str_len-name_length)];
        label4.zAttributedText = str;
        label4.numberOfLines=0;
        [label4 sizeToFit];
EN

回答 1

Stack Overflow用户

发布于 2013-03-07 13:20:49

Lucinda Grande在iOS中不可用,只能在Mac上使用。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/15128340

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档