美文网首页
那些年,总也记不住的AttributeName

那些年,总也记不住的AttributeName

作者: DovYoung | 来源:发表于2016-11-03 19:27 被阅读47次
    // Predefined character attributes for text. If the key is not in the dictionary, then use the default values as described below.
    
    //字体大小
    NSString * const NSFontAttributeName;                // UIFont, default Helvetica(Neue) 12
    //段落样式
    NSString * const NSParagraphStyleAttributeName;      // NSParagraphStyle, default defaultParagraphStyle
    //字体颜色
    NSString * const NSForegroundColorAttributeName;     // UIColor, default blackColor
    //字体背景色
    NSString * const NSBackgroundColorAttributeName;     // UIColor, default nil: no background
    //连字符
    NSString * const NSLigatureAttributeName ;            // NSNumber containing integer, default 1: default ligatures, 0: no ligatures
    //字间距
    NSString * const NSKernAttributeName ;                // NSNumber containing floating point value, in points; amount to modify default kerning. 0 means kerning is disabled.
    //删除线
    NSString * const NSStrikethroughStyleAttributeName ;  // NSNumber containing integer, default 0: no strikethrough
    //下划线
    NSString * const NSUnderlineStyleAttributeName ;      // NSNumber containing integer, default 0: no underline
    //边线颜色
    NSString * const NSStrokeColorAttributeName ;         // UIColor, default nil: same as foreground color
    //边线宽度
    NSString * const NSStrokeWidthAttributeName ;         // NSNumber containing floating point value, in percent of font point size, default 0: no stroke; positive for stroke alone, negative for stroke and fill (a typical value for outlined text would be 3.0)
    //阴影
    NSString * const NSShadowAttributeName ;              // NSShadow, default nil: no shadow
    
    NSString *const NSTextEffectAttributeName ;          // NSString, default nil: no text effect
    
     
    
    NSString * const NSAttachmentAttributeName ;          // NSTextAttachment, default nil
    
    NSString * const NSLinkAttributeName ;                // NSURL (preferred) or NSString
    
    NSString * const NSBaselineOffsetAttributeName ;      // NSNumber containing floating point value, in points; offset from baseline, default 0
    
    NSString * const NSUnderlineColorAttributeName ;      // UIColor, default nil: same as foreground color
    
    NSString * const NSStrikethroughColorAttributeName ;  // UIColor, default nil: same as foreground color
    
    NSString * const NSObliquenessAttributeName ;         // NSNumber containing floating point value; skew to be applied to glyphs, default 0: no skew
    
    NSString * const NSExpansionAttributeName ;           // NSNumber containing floating point value; log of expansion factor to be applied to glyphs, default 0: no expansion
    
     
    
    NSString * const NSWritingDirectionAttributeName NS_AVAILABLE(10_6, 7_0);    // NSArray of NSNumbers representing the nested levels of writing direction overrides as defined by Unicode LRE, RLE, LRO, and RLO characters.  The control characters can be obtained by masking NSWritingDirection and NSTextWritingDirection values.  LRE: NSWritingDirectionLeftToRight|NSWritingDirectionEmbedding, RLE: NSWritingDirectionRightToLeft|NSWritingDirectionEmbedding, LRO: NSWritingDirectionLeftToRight|NSWritingDirectionOverride, RLO: NSWritingDirectionRightToLeft|NSWritingDirectionOverride,
    
     
    
    NSString * const NSVerticalGlyphFormAttributeName;   // An NSNumber containing an integer value.  0 means horizontal text.  1 indicates vertical text.  If not specified, it could follow higher-level vertical orientation settings.  Currently on iOS, it's always horizontal.  The behavior for any other value is undefined.
    
     
    
    /************************ Attribute values ************************/
    
    // This defines currently supported values for NSUnderlineStyleAttributeName and NSStrikethroughStyleAttributeName. NSUnderlineStyle*, NSUnderlinePattern*, and NSUnderlineByWord are or'ed together to produce an underline style.
    
    typedef NS_ENUM(NSInteger, NSUnderlineStyle) {
    
        NSUnderlineStyleNone                                    = 0x00,
    
        NSUnderlineStyleSingle                                  = 0x01,
    
        NSUnderlineStyleThick NS_ENUM_AVAILABLE(10_0, 7_0)      = 0x02,
    
        NSUnderlineStyleDouble NS_ENUM_AVAILABLE(10_0, 7_0)     = 0x09,
    
     
    
        NSUnderlinePatternSolid NS_ENUM_AVAILABLE(10_0, 7_0)      = 0x0000,
    
        NSUnderlinePatternDot NS_ENUM_AVAILABLE(10_0, 7_0)        = 0x0100,
    
        NSUnderlinePatternDash NS_ENUM_AVAILABLE(10_0, 7_0)       = 0x0200,
    
        NSUnderlinePatternDashDot NS_ENUM_AVAILABLE(10_0, 7_0)    = 0x0300,
    
        NSUnderlinePatternDashDotDot NS_ENUM_AVAILABLE(10_0, 7_0) = 0x0400,
    
     
    
        NSUnderlineByWord NS_ENUM_AVAILABLE(10_0, 7_0)            = 0x8000
    
    } NS_ENUM_AVAILABLE(10_0, 6_0);
    
     
    
    // NSWritingDirectionFormatType values used by NSWritingDirectionAttributeName. It is or'ed with either NSWritingDirectionLeftToRight or NSWritingDirectionRightToLeft. Can specify the formatting controls defined by Unicode Bidirectional Algorithm.
    
    typedef NS_ENUM(NSInteger, NSWritingDirectionFormatType) {
    
        NSWritingDirectionEmbedding     = (0 << 1),
    
        NSWritingDirectionOverride      = (1 << 1)
    
    } NS_ENUM_AVAILABLE(10_11, 9_0);
    
     
    
    // NSTextEffectAttributeName values
    
    NSString *const NSTextEffectLetterpressStyle ;
    
     
    
    

    相关文章

      网友评论

          本文标题:那些年,总也记不住的AttributeName

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