Our DNA is written in Swift

Rich Text Update 1.4

Beginning with version 1.4 we will advance the version tags on DTCoreText and DTRichTextEditor in sync. DTCoreText is in charge of HTML parsing, display and HTML generation inside the editor component and thus all the changes done there are indirectly benefitting editor users as well.

I’ve begun to aggregate issues on both GitHub and our own private GitLab instance via milestones. These are the grouping unit collecting issues so that you can tell from which version onward these fixes or enhancements are available. Each milestone will become a tag, once it is completed and will represent a stable version.


You can always get a picture of the original issues if you filter them by milestone, like in this GitHub issue list for version 1.4.0 of DTCoreText

DTCoreText 1.4 Changes

  • ADDED: Support for including local CSS style sheet files
  • ADDED: DTHTMLWriter can now write HTML fragments with inline styles
  • CHANGED: Changed the way color-changing hyperlinks are drawn, code now unified in DTCoreTextLayoutFrame
  • CHANGED: You no longer need an override plist, all available system fonts now get loaded into the override table automatically
  • CHANGED: renamed the define for showing performance measurement so that they don’t show in normal DEBUG mode
  • CHANGED: strike-through and underline is now properly positioned and sized
  • FIXED: Dictation Placeholder not displayed if no text delegate set
  • FIXED: Line truncation problem going for longer than the paragraph
  • FIXED: RTL justified text too short to be justified would be left-aligned instead of being right-aligned
  • FIXED: Problem parsing CSS styles containing a !important tag
  • FIXED: Using Chinese characters would cause height problems in hyperlinks
  • FIXED: Having text with a shadow would cause bolder text due to it being drawn twice
  • FIXED: Images don’t keep aspect ratio on resize
  • FIXED: Element hyperlink URL did not get copied to DTTextAttachment
  • FIXED: code removed by accident would cause problem with custom views for links
  • FIXED: HTML encoding for Emoji Characters
  • FIXED: Static Framework was not linking in code from DTFoundation
  • FIXED: Static Framework building was missing embedded DTHTMLParser

The changes to how hyperlinks are drawn are breaking the API since before the color changing of hyperlinks that are touched was done inside DTLinkButton. But it was next to impossible to have these line up perfectly with the text. Now there is a mode on drawing (via bit mask) that allows you to draw a frame either with normal or highlighted hyperlinks.

The second big noticeable improvement relates to underlining. UIWebViews only do a nasty 1 px underline regardless of font size. The new method gets the line thickness and position from the CTFont. This causes underlines to look like in Pages. Also a great deal of effort was spent on having the lines always perfect pixel aligned, even on Retina displays.

DTRichTextEditor 1.4 Changes

  • ADDED: A delegation protocol that gives it feature parity with UITextView.
  • FIXED: override typing attributes (like setting bold with no selection) would be reset on a new line
  • FIXED: Autocorrection was broken due to removal of input delegate notification
  • UPDATED: DTCoreText to 1.4

At the time of this writing this version was not finalized and bug fixing still underway. But those are just finishing touches.

The other big and important improvement is that now the code lives on a GitLab server instead of Subversion. This unifies our workflow tremendously since we no longer have to keep copies of sub-projects inside the SVN repo. Instead everything is included as git submodules. Those are always pointing to an exact commit in the submodule. This way we have control over which version of the submodule we want to use and can advance the pointer if there is a new release without having to keep updating a full copy of the source code.

The other big advantage for all our clients comes from everybody having their own git user accounts. This way you can easily contribute enhancements in a project branch and create a merge request for them to be included in the master branch. Previously on Subversion I only had a single read-only user for everybody.

I am hoping that the new structure and the help of fabulous GitLab will enable a new form of social coding that we see as standard on GitHub. And that seeing other users helping out and squashing bugs will inspire a greater belief in the quality of this component as well as inspire contributing for the greater good.

The next version will finally implement proper list support. Two people have stepped forward to fund the development of this feature. This is a somewhat involved thing since we need to implement ability to protect certain parts of the text. You don’t want the user to be able to remove individual characters of a list item prefix. This can also benefit people who want to treat hyperlinks as a single unit.

Tagged as: ,

Categories: Updates

Leave a Comment

%d bloggers like this: