Rich Text
Http://pan.baidu.com/s/1pJnY8BL Drag the folder downloaded here into its own project into the header file #import "OHAttributedLabel.h" #import "OHParagraphStyle.h" # Import "OHTouchesGestureRecognizer.h" introduce these 3 header files Add coretext.framework //Create Rich Text string nsmutableattributedstring* attrstr = \ [nsmutableattributedstring attributedstringwithstring:\ @ "Remember, the Moonlight-stained ocean \ Do you remember, love let each other light up the night \ Why later we used silence instead of relying on the stars, gradually haze \ break away, turn back to In the first desolate waiting for loneliness, whether to find someone to fill the heart blank \ We become the world, the most familiar strangers in the future twists and turns, their own sorrow \ Only blame we love so rough, love so deep so dream woke up stranded silent wave \ but can not return to God, if at the beginning of the intersection to hold back the excited soul "]; [Attrstr settextcolor:[uicolor whitecolor]]; [attrstr settextcolor:[uicolor RedColor] Range:NSMakeRange ( 9,4)]; [Attrstr settextisunderlined:yes Range:nsmakerange (9, 4)]; [Attrstr SettextcoLor:[uicolor Greencolor] Range:nsmakerange (125,30)];//set style ohparagraphstyle* Paragraphstyle = [ Ohparagraphstyle defaultparagraphstyle]; paragraphstyle.textalignment = kcttextalignmentleft; Paragraphstyle.linebreakmode = kctlinebreakbywordwrapping; Paragraphstyle.firstlineheadindent = 0.F; Indentation for first line paragraphstyle.linespacing = 3.F; Increase space between lines by 3 points [Attrstr setparagraphstyle:paragraphstyle];   &N bsp; //Initialize Rich Text label Ohattributedlabel *label = \ [[Ohattributedlabel Alloc] Initwithframe:cgrectmake (0, 0, $)]; Label.attributedtext = attrstr; Label.center = self.view.center; //Add into the main view [Self.view Addsubview:label]; The following is Zhang code Http://www.cnblogs.com/YouXianMing/p/3656900.html This is the https://github.com/daktales/UIFontWDCus that sets the rich text fontTomloader need to drag the two folders downloaded here into the project what font you want to use to download the font from the Web to remember that it must be a TTF format file Oh Drag into the project and then introduce the header file and then get the font URL Register the font Set the font style effect as follows specific demo please check desktop • Backup demo FontStyle RELATED LINKS have http://www.cnblogs.com/YouXianMing/p/3656900.html thank bloggers for sharing