获取字符宽度:并非自适应。coretext去计算

获取字符宽度:并非自适应。coretext去计算
UniChar ch = [ns_str characterAtIndex:0];
    CGGlyph glyph = 0;
    CTFontGetGlyphsForCharacters(fontRef, &ch, &glyph, 1);
    CGSize glyphSize;
    CTFontGetAdvancesForGlyphs(fontRef, kCTFontHorizontalOrientation, &glyph, &glyphSize, 1);


你可能感兴趣的:(获取字符宽度:并非自适应。coretext去计算)