You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

88 lines
2.4 KiB

//
// NSMutableAttributedString+TY.h
// TYAttributedLabelDemo
//
// Created by tanyang on 15/4/8.
// Copyright (c) 2015年 tanyang. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
#import <CoreText/CoreText.h>
@interface NSMutableAttributedString (TY)
/**
*
*
* @param color
*/
- (void)addAttributeTextColor:(UIColor*)color;
- (void)addAttributeTextColor:(UIColor*)color range:(NSRange)range;
/**
*
*
* @param font
*/
- (void)addAttributeFont:(UIFont *)font;
- (void)addAttributeFont:(UIFont *)font range:(NSRange)range;
/**
*
*
* @param characterSpacing
*/
- (void)addAttributeCharacterSpacing:(unichar)characterSpacing;
- (void)addAttributeCharacterSpacing:(unichar)characterSpacing range:(NSRange)range;
/**
* 线
*
* @param style 线 线
* @param modifier 线 线
*/
- (void)addAttributeUnderlineStyle:(CTUnderlineStyle)style
modifier:(CTUnderlineStyleModifiers)modifier;
- (void)addAttributeUnderlineStyle:(CTUnderlineStyle)style
modifier:(CTUnderlineStyleModifiers)modifier
range:(NSRange)range;
/**
*
*
* @param strokeWidth
* @param strokeColor
*/
- (void)addAttributeStrokeWidth:(unichar)strokeWidth
strokeColor:(UIColor *)strokeColor;
- (void)addAttributeStrokeWidth:(unichar)strokeWidth
strokeColor:(UIColor *)strokeColor
range:(NSRange)range;
/**
*
*
* @param textAlignment
* @param linesSpacing
* @param paragraphSpacing
* @param lineBreakMode
*/
- (void)addAttributeAlignmentStyle:(CTTextAlignment)textAlignment
lineSpaceStyle:(CGFloat)linesSpacing
paragraphSpaceStyle:(CGFloat)paragraphSpacing
lineBreakStyle:(CTLineBreakMode)lineBreakMode;
- (void)addAttributeAlignmentStyle:(CTTextAlignment)textAlignment
lineSpaceStyle:(CGFloat)linesSpacing
paragraphSpaceStyle:(CGFloat)paragraphSpacing
lineBreakStyle:(CTLineBreakMode)lineBreakMode
range:(NSRange)range;
@end