<SPAN style="FONT-SIZE: 24px">獲取字符寬度:並非自適應。coretext去計算 UniChar ch = [ns_str characterAtIndex:0]; CGGlyph glyph = 0; CTFontGetGlyphsForCharacters(fontRef, &ch, &glyph, 1); CGSize glyphSize; CTFontGetAdvancesForGlyphs(fontRef, kCTFontHorizontalOrientation, &glyph, &glyphSize, 1); </SPAN>