gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-11-29 04:06:26 25 4
gpt4 key购买 nike

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

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 字体系列,它无法正常工作,应用程序崩溃,请帮助我。

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];

最佳答案

Lucinda Grande 不适用于 iOS,仅适用于 Mac OS X。

关于iphone - ios自定义标签不支持字体系列只支持Lucida Grande?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15128340/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com