CTLine

作者: 李潇南 | 来源:发表于2017-09-09 14:59 被阅读77次
    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);
    
    

    相关文章

      网友评论

          本文标题:CTLine

          本文链接:https://www.haomeiwen.com/subject/mczojxtx.html