首页
学习
活动
专区
圈层
工具
发布
    • 综合排序
    • 最热优先
    • 最新优先
    时间不限
  • 来自专栏云原生布道专栏

    【API使用系列】Core Text专题

    中文字符"]; //设置字体属性 CTFontRef font = CTFontCreateWithName(CFSTR("Georgia"), 40, NULL); [mabstring addAttribute :(id)kCTFontAttributeName value:(id)font range:NSMakeRange(0, 4)]; //设置斜体字 CTFontRef font = CTFontCreateWithName dictionaryWithObject:(id)[UIColor redColor].CGColor forKey:(id)kCTForegroundColorAttributeName]; //斜体 CTFontRef kCTCharacterShapeAttributeName value:(id)num range: NSMakeRange(0, 4)]; */ /* //设置字体属性 CTFontRef kCTSuperscriptAttributeName value:(id)num range:NSMakeRange(3, 1)]; */ /* //设置斜体字 CTFontRef

    1.2K30编辑于 2022-03-08
  • 来自专栏编程语言

    iOS lable多行取每行字符串

    getStrfromMorelineby:(UILabel*)lable withfont:(UIFont*)font withdic:(NSDictionary*)dic withstr:(NSString*)str{ CTFontRef

    1.5K20发布于 2018-08-03
  • 来自专栏落影的专栏

    文字排版入门—— 排版基础、CoreText和图文混排

    1、CTFont CTFontRef是CoreText的字体,可以读取字体的版权信息(copyright)、fontFamily、style等信息; CTFontCreateWithName()用于创建字体 CFIndex count ); 获取字体的ascent、descent、leading、bounding box等属性: CGFloat CTFontGetAscent( CTFontRef font ); CGFloat CTFontGetDescent( CTFontRef font ); CGFloat CTFontGetLeading( CTFontRef font ); CGRect CTFontGetBoundingBox( CTFontRef font ); 可以直接对某些字形进行渲染,参数font提供字体相关属性,glyphs数组提供字形,positions数组提供位置(可以通过 CTLine生成); void CTFontDrawGlyphs( CTFontRef font, const CGGlyph glyphs[_Nonnull],

    8.8K32发布于 2020-02-25
  • 来自专栏王大锤

    iOS的内存管理

    str= CFStringCreateWithCString(kCFAllocatorDefault, “hello world", kCFStringEncodingUTF8);   // 创建一个 CTFontRef 对象 CTFontRef fontRef = CTFontCreateWithName((CFStringRef)@"ArialMT", fontSize, NULL); 对于这些对象的引用计数的修改 如下所示: // 创建一个 CTFontRef 对象 CTFontRef fontRef = CTFontCreateWithName((CFStringRef)@"ArialMT", fontSize

    1.2K80发布于 2018-05-17
  • 来自专栏Helloted

    图文混排

    .CGColor range:NSMakeRange(5, 10)]; //字体 UIFont * font = [UIFont systemFontOfSize:25]; CTFontRef

    2.2K30编辑于 2022-06-06
  • 来自专栏程序员维他命

    VVeboTableView 源码解析

    CGContextScaleCTM(context,1.0,-1.0); //文字颜色 UIColor* textColor = color; //生成CTFont CTFontRef

    1.5K10发布于 2018-08-30
  • 来自专栏云原生布道专栏

    【IOS开发进阶系列】动画专题

    这样可以根据你的具体需要来决定字体属性应该是用CGFontRef类型还是CTFontRef类型(Core Text字体)。 同时字体大小也是用fontSize属性单独设置的,因为CTFontRef和CGFontRef并不像UIFont一样包含点大小。 CFStringRef fontName = (__bridge CFStringRef)font.fontName;     CGFloat fontSize = font.pointSize;     CTFontRef

    1.4K10编辑于 2023-10-16
领券