Skip to content
This repository
Newer
Older
100644 33 lines (32 sloc) 2.865 kb
fe9c4d40 »
2011-01-11 Added support for H1-H5 and P.
1 <h2>NSAttributedString HTML Additions</h2>
2 <h3>Introduction</h3>
4631fc5d »
2011-01-13 implemented SUB, SUP, U, OL
3 <p>This project aims to duplicate the methods <u>present on Mac OSX</u> which allow creation of <font face="Courier" color="blue">NSAttributedString</font> from HTML code.
fe9c4d40 »
2011-01-11 Added support for H1-H5 and P.
4 This is useful for drawing simple rich text - like this document - without having to use a UIWebView.</p>
1c672cb0 »
2011-01-16 Demo for long press on hyperlink, Fixed hyperlink on images.
5 <p><img src="Oliver.jpg" width="100" height="100"></p>
547edb47 »
2011-03-30 Overriding for text and link color support
6 <p style="color:orange;"><i>Hi! I'm Oliver and I appreciate your help!</i></p>
fe9c4d40 »
2011-01-11 Added support for H1-H5 and P.
7 <h3>Features</h3>
9ca5d682 »
2011-01-12 Added UL/LI support
8 <p>At <em>present</em> the following tags are <b>supported</b>:</p>
4631fc5d »
2011-01-13 implemented SUB, SUP, U, OL
9 <ul><li>Headers <b>H1</b> - <b>H6</b></li><li>Paragraphs: <b>P</b></li><li>Bold: <b>B</b>, <b>STRONG</b></li><li>Italic: <b>I</b>, <b>EM</b></li>
10 <li>Underline <b>U</b></li>
3e55d2eb »
2011-05-20 Implemented proper font-size reduction and baseline shift for SUB and…
11 <li>Superscript <b>SUP</b> and Subscript <b>SUB</b>, e.g. e = mc<sup>2</sup></li>
4274b652 »
2011-06-13 support for STRIKE tag to behave like DEL tag
12 <li>Strike Out <b>DEL</b>, e.g. <del>Something Removed</del> or <b>STRIKE</b> e.g. <strike>Something Striked</strike></li>
37cf3a66 »
2011-05-04 moved iPhone special case define to pch, hoping that somebody might f…
13 <li><b>FONT</b> (face,color and size 1-7)</li>
8fe54dd7 »
2011-05-04 Update Readme
14 <li>Horizontal Rule <b>HR</b> (coloring via background-color style, simplified)</li>
37cf3a66 »
2011-05-04 moved iPhone special case define to pch, hoping that somebody might f…
15 <li>Hyperlinks <b>A</b> (<a>Formatting</a> only, clickable as custom view)</li>
4631fc5d »
2011-01-13 implemented SUB, SUP, U, OL
16 <li>Unordered Lists <b>LI</b></li>
17 <li>Ordered Lists <b>OL</b></li></ul>
37cf3a66 »
2011-05-04 moved iPhone special case define to pch, hoping that somebody might f…
18 <p>Currently attributes are inherited from enclosed tags via brute force. I don't know if this is accurate.</p>
86b15018 »
2012-02-02 Updated both readies with known differences between Mac's initWithHTM…
19 <h3>Known Differences</h3>
20 <p>In many aspects DTCoreText is superior to the Mac version of generating NSAttributedStrings from HTML. These become apparent in the MacUnitTest where the output from both is directly compared. I am summarizing them here for references.</p>
21 <p>In the following "Mac" means the initWithHTML: methods there, "DTCoreText" means DTCoreText's initWithHTML and/or DTHTMLAttributedStringBuilder</p>
22 <ul>
23 <li>Mac does not support the video tag, DTCoreText does.</li>
24 <li>DTCoreText is able to synthesize small caps by putting all characters in upper case and using a second smaller font for lowercase characters.</li>
25 <li>I suspect that Mac makes use of the -webkit-margin-* CSS styles for spacing the paragraphs, DTCoreText only uses the -webkit-margin-bottom and margin-bottom at present.</li>
26 <li>Mac supports CSS following addresses, e.g. "ul ul" to change the list style for stacked lists. DTCoreText does not support that and so list bullets stay the same for multiple levels.</li>
27 </ul>
4631fc5d »
2011-01-13 implemented SUB, SUP, U, OL
28
29 <h3>Please Help!</h3>
caba4956 »
2011-05-25 Finished implementation of list-style for the most useful list-styles…
30 <p>If you find brief test cases where the created <font face="Courier" color="blue">NSAttributedString</font> differs from the version on OSX please send them to us!</p>
31 <p>Also there are many small things that you could help this project with. You can either implement these yourself or sponsor their development.</p>
32 <p>Follow <a href="http://twitter.com/cocoanetics">@cocoanetics</a> on Twitter</p>
a2c8682e »
2011-01-19 Fixed Whitespace handling
33 <p>This code is covered by a BSD License. &copy; 2011 Oliver Drobnik</p>
Something went wrong with that request. Please try again.