Dec 30, 2012
Other people take off the Christmas holidays to have fun. I delight in using the time away from normal programming work to work on DTCoreText.
There are many wide-reaching changes to warrant an increase in version number on the second digit. I need to sum them up in this location because you might have projects that rely on DTCoreText for displaying attributed strings.
Dec 23, 2012
Over the past week I’ve been working on enhancing DTRichTextEditor and – by extension – some of the enhancements also went into DTCoreText, which is in charge of HTML parsing, generation and display of thusly generated NSAttributedStrings. Today I present version 1.1 which brings these fine enhancements:
- ADDED: Support for Undo/Redo
- ADDED: Setting and changing font family and size for ranges
- ADDED: Support for indenting
- CHANGED: Lots of documentation added, refactoring and cleanup
- FIXED: text scaling bug when pasting
- UPDATED: DTCoreText + DTFoundation submodules
This work was sponsored by Rick Meyers who is including DTRichTextEditor in his e-Sword HD iPad app.
Dec 22, 2012
I had my PDF experiments inside DTFoundation. Those included a rather large (compared to the other source code) PDF file I was using for testing and the Demo. The problem with this was that I’m using DTFoundation almost everywhere now, being the central repository for all my generally reusable code.
Because of this file every cloning of the repository would take forever. So I decided to split the PDF stuff into its own repository and I deleted the file. However – since git keeps all history forever – the clones would still take long.
Dec 20, 2012
In June we announced that we had begun a private BETA of Airship Commander. Several of our clients had also began to use the app internally to push notifications to users of their apps. Today we are happy to announce that we submitted version 1.0 to Apple for approval.
Dec 19, 2012
That was an easy Radar for me to file. It’s not a bug, but it is bugging me nevertheless.
I am disturbed by the disparity between the NSShadowAttributeName attribute (which can only hold a single NSShadow) and CSS where you can have multiple shadows. Because NSHTMLWriter simply copies these to the CSS style of a span it should be quite easy to to also let NSHTMLWriter take an array.
It’s not a very important feature to have, but hey … it would give me some peace of mind.
Filed as Radar#12908144.
Dec 16, 2012
While researching the root cause for the UITextView line-height bug I also found another difference between attributed strings rendered via CoreText and UITextView. The latter ignores font kerning.
UITextView uses Webkit for displaying attributed strings. Unfortunately Kerning is disabled on Webkit views unless you specify a certain CSS style.
If you look at the AV characters you can see how the version with Kerning enabled has the AV seem at a more natural distance while the lower line has an uncomfortably wide distance between them.
In the Radar (which I filed under #12889869) I argue that when setting text on UITextView via setAttributedString we developers expect for Kerning to be on by default since this is the way that is closest to how CoreText renders it.
Dec 15, 2012
I had begun development on DTRichTextEditor a few months before WWDC 2012. This was the time when Apple announced that UIKit would support attributed strings beginning with iOS 6. 3 classes to be exact – if you search the documentation for the attributedText property – UILabel, UITextField and UITextView.
Back then I I was hesitant to concede that Apple had sherlocked my open source work in DTCoreText. Yes, there where a few formatting styles now supported, but still the initWithHTML which exists on Mac was still nowhere to be seen on iOS. In the least people would still be able to bridge the gap from HTML to NSAttributedString with my classes.
As I dove more into making DTCoreText compatible with new attributes used by iOS 6 I found the approach that Apple chose to take quite limited and extremely incomplete.
Dec 13, 2012
Recently I’ve been getting more and more requests from potential clients to show them the license that is attached to components they would purchase from my parts store. I didn’t have any except some verbal description.
On open source software I now routinely add a 2-clause BSD license, so it was about time to also get a proper license for my commercial components.
Here’s the license I am going to use from now on. I adapted it from the commercial Development License that Peter Steinberger uses on his PSPDFKit, with a few modifications. Peter only allows use for a single app, our components can be used in all apps published via the licensee’s app store account.
So if you develop apps for yourself then you just need to purchase one license for all your apps. If you develop an app for somebody else then this third party has to obtain a license (or you have to obtain it in their name). You can also purchase an Extended License upgrade that lifts this restriction.
This license also adds permission for me to mention your company on Cocoanetics.com. It also now allows for providing modified versions of the component source code to third parties, provided that those are also holders of a separate license.
If you are an existing license holder for any of our things then it won’t hurt if you get in touch with us and see if your licensing is still ok for your specific use case.
Dec 12, 2012
I’m working on making DTCoreText iOS 6 compatible and when implementing line heights I found this problem. Naturally I filed a radar.
This is one of many shortcomings of UIKit’s support for attributed strings. A workaround for this was described as having to omit font attributes from the attributed string. So you can either have multiple fonts and unchanging line height or only the font you set on the font property of UITextView.
Other people are having the same problem, as outlined by this question on StackOverflow.
Filed as rdar://12863734