CTLine

typedef const struct CF_BRIDGED_TYPE(id) __CTLine * CTLineRef;

typedef CF_OPTIONS(CFOptionFlags, CTLineBoundsOptions) {
    kCTLineBoundsExcludeTypographicLeading  = 1 << 0,
    kCTLineBoundsExcludeTypographicShifts   = 1 << 1,
    kCTLineBoundsUseHangingPunctuation      = 1 << 2,
    kCTLineBoundsUseGlyphPathBounds         = 1 << 3,
    kCTLineBoundsUseOpticalBounds           = 1 << 4,
    kCTLineBoundsIncludeLanguageExtents CT_ENUM_AVAILABLE(10_11, 8_0) = 1 << 5,
};

typedef CF_ENUM(uint32_t, CTLineTruncationType) {
    kCTLineTruncationStart  = 0,
    kCTLineTruncationEnd    = 1,
    kCTLineTruncationMiddle = 2
};

CFTypeID CTLineGetTypeID( void ) CT_AVAILABLE(10_5, 3_2);

CTLineRef CTLineCreateWithAttributedString(
    CFAttributedStringRef attrString ) CT_AVAILABLE(10_5, 3_2);

CTLineRef __nullable CTLineCreateTruncatedLine(
    CTLineRef line,
    double width,
    CTLineTruncationType truncationType,
    CTLineRef __nullable truncationToken ) CT_AVAILABLE(10_5, 3_2);

CTLineRef __nullable CTLineCreateJustifiedLine(
    CTLineRef line,
    CGFloat justificationFactor,
    double justificationWidth ) CT_AVAILABLE(10_5, 3_2);

CFIndex CTLineGetGlyphCount(
    CTLineRef line ) CT_AVAILABLE(10_5, 3_2);

CFArrayRef CTLineGetGlyphRuns(
    CTLineRef line ) CT_AVAILABLE(10_5, 3_2);

CFRange CTLineGetStringRange(
    CTLineRef line ) CT_AVAILABLE(10_5, 3_2);

double CTLineGetPenOffsetForFlush(
    CTLineRef line,
    CGFloat flushFactor,
    double flushWidth ) CT_AVAILABLE(10_5, 3_2);

void CTLineDraw(
    CTLineRef line,
    CGContextRef context ) CT_AVAILABLE(10_5, 3_2);

double CTLineGetTypographicBounds(
    CTLineRef line,
    CGFloat * __nullable ascent,
    CGFloat * __nullable descent,
    CGFloat * __nullable leading ) CT_AVAILABLE(10_5, 3_2);

CGRect CTLineGetBoundsWithOptions(
    CTLineRef line,
    CTLineBoundsOptions options ) CT_AVAILABLE(10_8, 6_0);

double CTLineGetTrailingWhitespaceWidth(
    CTLineRef line ) CT_AVAILABLE(10_5, 3_2);

CGRect CTLineGetImageBounds(
    CTLineRef line,
    CGContextRef __nullable context ) CT_AVAILABLE(10_5, 3_2);

CFIndex CTLineGetStringIndexForPosition(
    CTLineRef line,
    CGPoint position ) CT_AVAILABLE(10_5, 3_2);

CGFloat CTLineGetOffsetForStringIndex(
    CTLineRef line,
    CFIndex charIndex,
    CGFloat * __nullable secondaryOffset ) CT_AVAILABLE(10_5, 3_2);

void CTLineEnumerateCaretOffsets(
    CTLineRef line,
    void (^block)(double offset, CFIndex charIndex, bool leadingEdge, bool* stop) ) CT_AVAILABLE(10_11, 9_0);

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • 希望你能明白,比起那個(gè)火急火燎地拉著你去賓館的人,那些默默站在你身后為考慮一切的人更值得你去愛(ài)! 2017年8月2...
    冬白love閱讀 529評(píng)論 8 9
  • 如何建立高質(zhì)量的交流呢?關(guān)鍵一點(diǎn)是交流的時(shí)候要更私人,最好沒(méi)有打擾的,更好是一對(duì)一的交流。 和菜頭在《知人之明》中...
    學(xué)習(xí)富本閱讀 651評(píng)論 1 2
  • 外圍線outline--css 1.表單獲取焦點(diǎn)事件onfocus; 例:input.onfocus=functi...
    他在發(fā)呆閱讀 727評(píng)論 0 0

友情鏈接更多精彩內(nèi)容