typedef NS_ENUM(NSInteger, FRNoteStepsType) {//B加粗? I傾斜? U下劃線? S中間橫線
? ? FRNoteStepsTypeTextNormal=3030,//Note頁輸入字體無狀態(tài)
? ? FRNoteStepsTypeTextBold,//Note頁輸入字體加粗
? ? FRNoteStepsTypeTextTilt,//Note頁輸入字體傾斜
? ? FRNoteStepsTypeTextTiltUnderLine,//Note頁輸入字體添加下劃線
? ? FRNoteStepsTypeTextTiltHorizontalLine,//Note頁輸入字體添加中間橫線
? ? FRNoteStepsTypeTextBI,//加粗+傾斜
? ? FRNoteStepsTypeTextBU,//加粗+下劃線
? ? FRNoteStepsTypeTextBS,//加粗+中間橫線
? ? FRNoteStepsTypeTextIU,//傾斜+下劃線
? ? FRNoteStepsTypeTextIS,//傾斜+中間橫線
? ? FRNoteStepsTypeTextUS,//下劃線+中間橫線
? ? FRNoteStepsTypeTextBIU,//加粗+傾斜+下劃線
? ? FRNoteStepsTypeTextBIS,//加粗+傾斜+中間橫線
? ? FRNoteStepsTypeTextBUS,//加粗+下劃線+中間橫線
? ? FRNoteStepsTypeTextIUS,//傾斜+下劃線+中間橫線
? ? FRNoteStepsTypeTextBIUS,//加粗+傾斜+下劃線+中間橫線
};
//設(shè)置新的富文本內(nèi)容
+ (NSAttributedString*)getNewsAttribute:(NSString*)inputTexttextAttribute:(FRNoteStepsType)textAttribute textColor:(UIColor*)textColor{
? ? UIColor*attColor = textColor ? textColor :kBaseModel.cellTitleColor;
? ? switch(textAttribute) {
? ? ? ? case FRNoteStepsTypeTextNormal://Note頁輸入字體無狀態(tài)
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_SystemFont(16),NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextBold://Note頁輸入字體加粗
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_MediumFont(16),NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextTilt://Note頁輸入字體傾斜
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName :FR_SystemFont(16),NSObliquenessAttributeName : @(0.5),NSExpansionAttributeName : @(0),NSVerticalGlyphFormAttributeName : @(0),NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextTiltUnderLine://Note頁輸入字體添加下劃線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName :FR_SystemFont(16),NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),NSUnderlineColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextTiltHorizontalLine://Note頁輸入字體添加中間橫線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName :FR_SystemFont(16),NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle),NSStrikethroughColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextBI://加粗+傾斜
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_MediumFont(16),NSObliquenessAttributeName : @(0.5),NSExpansionAttributeName : @(0),NSVerticalGlyphFormAttributeName : @(0),NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextBU://加粗+下劃線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_MediumFont(16),NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),NSUnderlineColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextBS://加粗+中間橫線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_MediumFont(16),NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle),NSStrikethroughColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextBIU://加粗+傾斜+下劃線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_MediumFont(16),NSObliquenessAttributeName : @(0.5),NSExpansionAttributeName : @(0),NSVerticalGlyphFormAttributeName : @(0),NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),NSUnderlineColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextBIS://加粗+傾斜+中間橫線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_MediumFont(16),NSObliquenessAttributeName : @(0.5),NSExpansionAttributeName : @(0),NSVerticalGlyphFormAttributeName : @(0),NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle),NSStrikethroughColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextBUS://加粗+下劃線+中間橫線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_MediumFont(16),NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),NSUnderlineColorAttributeName : attColor,NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle),NSStrikethroughColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextBIUS://加粗+傾斜+下劃線+中間橫線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_MediumFont(16),NSObliquenessAttributeName : @(0.5),NSExpansionAttributeName : @(0),NSVerticalGlyphFormAttributeName : @(0),NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),NSUnderlineColorAttributeName : attColor,NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle),NSStrikethroughColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextIU://傾斜+下劃線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName :FR_SystemFont(16),NSObliquenessAttributeName : @(0.5),NSExpansionAttributeName : @(0),NSVerticalGlyphFormAttributeName : @(0),NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),NSUnderlineColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextIS://傾斜+中間橫線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_SystemFont(16),NSObliquenessAttributeName : @(0.5),NSExpansionAttributeName : @(0),NSVerticalGlyphFormAttributeName : @(0),NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle),NSStrikethroughColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextIUS://傾斜+下劃線+中間橫線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName : FR_SystemFont(16),NSObliquenessAttributeName : @(0.5),NSExpansionAttributeName : @(0),NSVerticalGlyphFormAttributeName : @(0),NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),NSUnderlineColorAttributeName : attColor,NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle),NSStrikethroughColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? case FRNoteStepsTypeTextUS://下劃線+中間橫線
? ? ? ? {
? ? ? ? ? ? NSAttributedString *attributeStr = [[NSAttributedString alloc] initWithString:inputText attributes:@{NSForegroundColorAttributeName:attColor,NSFontAttributeName :FR_SystemFont(16),NSUnderlineStyleAttributeName : @(NSUnderlineStyleSingle),NSUnderlineColorAttributeName : attColor,NSStrikethroughStyleAttributeName : @(NSUnderlineStyleSingle),NSStrikethroughColorAttributeName : attColor,NSKernAttributeName :@(1)}];
? ? ? ? ? ? returnattributeStr;
? ? ? ? }
? ? ? ? ? ? break;
? ? ? ? default:
? ? ? ? ? ? break;
? ? }
?? ?return [[NSAttributedString alloc]initWithString:inputText];
}