Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 61 lines (36 sloc) 3.214 kB
8b2ad80 @Cocoanetics Updated readme
authored
1 DTCoreText
2 ==========
571ae6e @soffes Pretty readme to show off features
soffes authored
3
8b2ad80 @Cocoanetics Updated readme
authored
4 This project aims to duplicate the methods present on Mac OSX which allow creation of `NSAttributedString` from HTML code on iOS. Previously we referred to it as NSAttributedString+HTML (or NSAS+HTML in short) but this only covers about half of what this framework does.
5
04d37a0 @Cocoanetics Added Pledgie to Readme
authored
6 Please support us so that we can continue to make DTCoreText even more awesome!
7
8 <a href='http://www.pledgie.com/campaigns/16615'><img alt='Click here to lend your support to: Migrate DTCoreText to libxml2 and make a donation at www.pledgie.com !' src='http://www.pledgie.com/campaigns/16615.png?skin_name=chrome' border='0' /></a>
9
8b2ad80 @Cocoanetics Updated readme
authored
10 The project covers two broad areas:
11
12 1. Layouting - Interfacing with CoreText, generating NSAttributedString instances from HTML code
13 2. UI - several UI-related classes render these objects
571ae6e @soffes Pretty readme to show off features
soffes authored
14
15 This is useful for drawing simple rich text like any HTML document without having to use a `UIWebView`.
16
5c366fa @Cocoanetics Added link to Q&A
authored
17 Please read the [Q&A](http://www.cocoanetics.com/2011/08/nsattributedstringhtml-qa/).
18
170bbfb @Cocoanetics Restructured and unified attachment handling for img, video, iframe, …
authored
19 Your help is much appreciated. Please send pull requests for useful additions you make or ask me what work is required.
571ae6e @soffes Pretty readme to show off features
soffes authored
20
21 If you find brief test cases where the created `NSAttributedString` differs from the version on OSX please send them to us!
22
23 Follow [@cocoanetics](http://twitter.com/cocoanetics) on Twitter.
f6daeef @Cocoanetics Added note about CoreText loading performance workaround to Readme
authored
24
8b2ad80 @Cocoanetics Updated readme
authored
25 License
26 -------
27
28 It is open source and covered by a standard BSD license. That means you have to mention *Cocoanetics* as the original author of this code. You can purchase a Non-Attribution-License from us.
29
30 Usage
31 -----
32
e2dae92 @Cocoanetics Fixed spello
authored
33 DTCoreText needs a minimum iOS deployment target of 4.3 because of:
60cfab5 @Cocoanetics Updated readme
authored
34
35 - NSCache
36 - GCD-based threading and locking
37 - Blocks
44061fa @Cocoanetics Updated Readme
authored
38 - ARC
60cfab5 @Cocoanetics Updated readme
authored
39
8b2ad80 @Cocoanetics Updated readme
authored
40 These are your options for adding DTCoreText to your project.
f6daeef @Cocoanetics Added note about CoreText loading performance workaround to Readme
authored
41
60cfab5 @Cocoanetics Updated readme
authored
42 1. Copy all classes and headers from the Core/Source folder to your project.
43 2. Link your project against the libDTCoreText static library. Note that the "Static Library" target does not produce a universal library. You will also need to add all header files contained in the Core/Source folder to your project.
8b2ad80 @Cocoanetics Updated readme
authored
44 3. Link your project against the universal static library produced from the "Static Framework".
45
44061fa @Cocoanetics Updated Readme
authored
46 When linking you need to add the -ObjC and -all_load to your app target's "Other Linker Flags". If your app does not use ARC yet (but DTCoreText does) then you also need the -fobjc-arc linker flag.
8b2ad80 @Cocoanetics Updated readme
authored
47
60cfab5 @Cocoanetics Updated readme
authored
48 When building from source it is recommended that you at the ALLOW_IPHONE_SPECIAL_CASES define to your PCH, this setting is "baked into" the library and framework targets.
49
8b2ad80 @Cocoanetics Updated readme
authored
50 Known Issues
51 ------------
f6daeef @Cocoanetics Added note about CoreText loading performance workaround to Readme
authored
52
53 CoreText has a problem prior to iOS 5 where it takes around a second on device to initialize its internal font lookup table. You have two workarounds available:
54
55 - trigger the loading on a background thread like shown in http://www.cocoanetics.com/2011/04/coretext-loading-performance/
56 - if you only use certain fonts then add the variants to the DTCoreTextFontOverrides.plist, this speeds up the finding of a specific font face from the font family
3e41ffc @Cocoanetics Updated Readme with new known issue
authored
57
58 Some combinations of fonts and unusual list types cause an extra space to appear. e.g. 20 px Courier + Circle
8b2ad80 @Cocoanetics Updated readme
authored
59
60 If you find an issue then you are welcome to fix it and contribute your fix via a GitHub pull request.
Something went wrong with that request. Please try again.