Formatted Text Control Has a New Home and is Open Sourced

One of the biggest shortcomings of Xojo is the lack of a full word processor control. The built-in TextArea doesn’t support images, hyperlinks, full RTF support, page layout view, and so much more. For many Xojo developers it’s a major missing piece. Early on in our consulting projects we found this shortcoming to be a major hindrance so we needed to find a solution.

Like most Xojo developers we turned to the third-party market and found Formatted Text Control that had been developed by Brendan Murphy of True North Software. When Brendan decided to leave the community we purchased the rights to Formatted Text Control and continued its development.

FTC was originally based on the Canvas control and when Xojo was updated to support Cocoa the canvas no longer did proper keyboard handling in macOS. After butting heads with Xojo they released the Text Input Canvas (as open sourced and to this day not properly documented) we had to scramble to update FTC to use it rather than the Canvas. Then we added Retina support, fixed any number of bugs and added features that I’d have to look in git to remember.

And then, like so many things in life, we didn’t use FTC in practically any projects. For years. And when that happens you tend to forget about it and it’s no longer an important thing.

In 2019 we made some serious effort to update FTC but it never went beyond some proof of concept projects and research. By the end of 2019 we recognized that consulting was slowing down to the point it was time to get a full-time job. Obviously all work on FTC stopped. In March of 2020 I found a full-time job (still doing Xojo development) and since then I’ve been slowly selling off products when I found a good home for them.

Today, I’m pleased to announce that Formatted Text Control has found a new home and will become open sourced! Dr. Brian Gaines has been an FTC user since before we purchased it in 2007 and it’s the basis for his suite of conceptual modeling tools. Since those tools will be open source in the near future, FTC will be open source as well. More information can be found at

I believe that under the stewardship of Dr. Gaines and the open source community FTC will grow and change in ways that I never envisioned. It’s such an important tool for Xojo developers that I envision a lot of interest in it.

I thank Dr. Gaines for purchasing the rights to FTC and for open sourcing it. I want to thank everyone in the community that used FTC over the years, submitted bug reports, and asked those challenging questions on what FTC can and can’t do.

Happy coding!

Formatted Text Control 3.2.1

BKeeney Software has released version 3.2.1 of the Formatted Text Control, a canvas based word processing control for Xojo Mac OS X and Windows applications. The FTC is an alternative to the built-in TextArea control and allows for in-line graphics, hyperlinks, custom components, better RTF support and much more. The demo project has quite a few examples, including a Masked Text Field, XojoScript example, Embedded FTC (in your own canvas), as well as a word processor with page view.

The Formatted Text Control costs $150 and is 100% unencrypted Xojo code. Version 3 and above requires the use of the Text Input Canvas plugin (included in package) to allow for proper text handling in Cocoa builds.

Download links and more information at 

This version has a number of bug fixes reported by users since release. It is recommended for all users. Registered users should be receiving an email from our automated distribution system.

Bug Fixes:

  • Fixed issue where all StyleRuns after a hyperlink will also be marked as hyperlink
  • Issue #4074: RTF clipboard ignores hyperlinks with umlauts and cuts them
  • Issue #4087: missing RTF space after “\kerning0” keyword
  • Issue #4130: FTXojoScriptField: Left part of the text is hidden by the section of the line number.
  • Issue #4135: Migrating texts from a TextArea to the FTC (Ich migrieren Texte aus einer TextArea in das FTC)
  • Issue #4196: Remove GOTO calls from FTC

Formatted Text 3.2

Lenexa, KS (February 12th 2019) — BKeeney Software Inc. releases a major update to Formatted Text Control. Developers can now implement tab leaders, change character spacing, implement text drop shadows, and use standard keyboard handling in their applications that require a robust word processing control. This version contains dozens of new, changed, and updated items.

Formatted Text Control (FTC) is a set of classes that offer developers word processing capabilities for their Mac and Windows desktop applications. FTC has several viewing modes that gives users a choice of Page View, Edit View, or Single Line view. FTC supports inline graphics, hyperlinks, and text formatting that the built-in Xojo TextArea control just can’t do. Users can import and save text, RTF, and XML format documents.

FTC version 3.2.0 is a free update to all 3.x users and is recommended. Existing users should be notified via FileShare but can contact BKeeney Software at if they have any questions.

FTC is sold as unencrypted source code and costs $150 USD. More information and demo projects are available at .

Complete change list:
New Items:

  • Contains code from the ImagePlay Effects Library – 
  • Tab Leaders implemented
  • Issue #3832: Implement Control + Up/Down Arrow Key Handling
  • Issue #3833: Implement paragraph moving via keyboard handling
  • Issue #3700: Drop Shadow available on Windows and Linux
  • Issue #3795: The FTDocument properties characterStyles and paragraphStyles need to be accessible to subclasses.

Added CharacterStyles and ParagraphStyles getter/setters so developers can create their own style editor.
* Character Spacing implemented (requires Xojo >= 2015.4)

Bug Fixes:

  • Issue #3650: CustomObjects Demo: Added FTFile.Clone method so it works with FTIterator propertly.
  • Issue #3653: macOS: “getDoubleClickTime” – Cocoa replacement for old CarbonLib call
  • Issue #3699: Add Win64 Declares
  • Issue #3654: Hi-DPI Mode: FTPicture – Handles drawn incorrect and matches wrong.
  • Issue #3702: DragRect is half height in HiDPI
  • Fixed an issue with FTParagraph clones that have a different ID after going through the FTIterator
  • Issue #2007/3605: Candidate Window Shows up in Wrong Location
  • Issue #3646: FTParagraph.getXML saves wrong TabStop Properties
  • Issue #3709: FTPicture ignores Nudge property
  • Issue #3748: FTDocument.selectionBold,Italic, shadow, strikethrough, subscript, superscript, underline now works properly
  • Issue #3752: FTRBScript: Fix for printing line numbers
  • Issue #3763: RTFReader/FtcRtfReader ignored the left/right margin and first indent of paragraphs.
  • Issue #3764: RTFReader ignored “\sb” SpaceBefore of paragraphs.
  • Win64 Issue: Modified FTCUndoPaste.constructor and FTCUndoManager.savePaste to allow pasting (Xojo Compiler Issue. Feedback 53967)
  • Issue #3750: Suggestion & comparison of the Office applications for the display optimization of the paragraph background color
  • Issue #3775: Implement Corner Color Property in Formatted Text (Switch between Light/DarkMode – Xojo Version >= 2018.3)
  • Issue #3777: Implement Page Shadow Property in Formatted Text (Switch between Light/DarkMode – Xojo Version >= 2018.3)
  • Issue #3755: Printing has the side-effect of scrolling the editing window to the top
  • Issue #3794: FTDocument.getSelectedParagraphs returns first paragraph of multi-paragraph doc regardless of insertion point
  • Issue #3796: FTStyleRun.copyStyleData does not copy background color
  • Issue #3820: RTFWriter missed “\par” after the last Paragraph
  • Issue #3774: FormattedText — changeParagraphMargins method name changeParagraphMarigns
  • Issue #3762: FTDocument.selectionFontColor returns sameColor false when it should be true
  • Issue #3842: FTStyleRun.updateWith Style sets textColor black when undefined
  • Issue #3806: FTDocument.addParagraphStyle and addCharacterStyle bypassed by insertXML and cannot be overridden in subclass
  • Issue #3818: Print RB Code Editor: Unwanted positive y-offset of the content compared to its line number
  • Issue #3637: FTCParagraphStyle.backgroundColor won’t set correctly
  • Issue #3910: RTF-Reader ignores local value for first line indent in paragraphs
  • Issue #3914: First Paragraph on Page with Background Color ignores Before Space
  • Issue #3917: Paragraphs Background Color ignores Hanging Indent


  • Renamed FormattedText.xDisplayPosition to FormattedText.hScrollValue to better reflect what it is.
  • Renamed FormattedText.lastXDisplayPosition to FormattedText.lastHScrollValue
  • Renamed FormattedText.yDisplayPosition to FormattedText.vScrollValue to better reflect what it is.
  • Renamed FormattedText.lastYDisplayPosition to FormattedText.lastVScrollValue
  • Renamed FormattedText.GetResolution to FormattedText.GetMonitorPixelsPerInch to better reflect what it does.
  • Renamed FTDocument.SetResolution to FTDocument.setMonitorPixelsPerInch
  • Renamed FTDocument.GetResolution to FTDocument.getMonitorPixelsPerInch
  • Renamed FTDocument.Resolution to FTDocument.MonitorPixelsPerInch
  • FormattedText.DISPLAY_ALIGN_CENTER/LEFT/RIGHT replaced with Display_Alignment enum
  • FormattedText.MODE_PAGE/NORMAL/EDIT/Single replaced with Display_Mode enum
  • FTLine.FIRST_LINE/MIDDLE/LAST/BOTH replaced with Line_Type enum
  • FTPicture.Handle constants converted to FTPicture.Handle_Type enum
  • FTParagraph.Alignment constants converted to FTParagraph.Alignment_Type enum
  • Removed Alignment constants from RTFConstants module
  • Changed how hyperlinks are drawn in FTObject.drawHyperLink
  • Changed how the gradient shadow is drawn in FTPage.drawPageViewMode
  • Changed how strikethroughs are drawn in FTObject.drawStrikethrough
  • Changed how underline is drawing in FTObject.drawUnderline
  • Can now read/write shadow properties from/to RTF Documents
  • Added AcceptFileDrop to test window for testing custom objects. Added FTFile into project.
  • Changed how Styles are saved and read in XML format.
  • Issue #3802/1456: Command + (Shift Key) + Arrow Keys doesn’t move insertion point correctly
  • Changed RB Script classes to Xojo Script.
  • Now have TabLeaders (WORK IN PROGRESS)
  • Embedded FTC demo now does text formatting with keyboard shortcuts.
  • Removed unused FTDocument.DocOffset method.
  • Fixed TargetCocoa and TargetWin32 constants with more appropriate ones for 2018 R4.
  • Removed duplicated code line in RTFReader.SetupKnownCommands
  • Updated ParagraphWindow to easy format First Line and Hanging Indents

* Issue #3753: PageBreaks won’t load from RTF

A Xojo Existential Crisis:  When Self is Nil

A couple of Formatted Text Control users found an interesting bug in the Xojo Windows 64-bit compiler.  If the user pasted anything into the control it would hard crash the Windows application.  I spent a couple of days trying to find a workaround and was flummoxed on how to fix.  Thankfully there’s an easy workaround thanks to Team Xojo.

In the Open event of the FTC control we create a new FTCUndoManager instance.  When the user pastes something into the control we pass the existing text into the Undo Manager so it can properly save the before state and allow an undo of the paste.

Pasting text calls the SavePaste method of the FTCUndoManager class.  This is where things start to go wrong.  This method passes Self into the constructor for the FTCUndoPaste class.  Stopping the debugger in this method shows us that self is nil!  What’s odd is several other passed in class objects are nil too (even though they are not at the control level).  That self is nil is indeed a problem since FTCUndoPaste needs the reference to the UndoManager for a variety of reasons.

How can self be nil?  After all this is a method in the class.  By definition self should be non-nil.  I think this would fall under ‘compiler problem’.  I submitted a private Feedback report to Xojo (53967)  and thankfully Xojo reviewed it quickly and were intrigued enough to look into it.  It was verified and a workaround was quickly found.

William from Xojo wrote this:  

There seems to be an issue with passing byval structure parameters (for 64-bit Window build), as a workaround you can pass these byref instead, i.e. MyFunction(…, Byref firstPa as ParagraphAttributes)

So I was able to change two methods, FTCUndoManager.savePaste and FTCUndoPaste.constructor, by using byRef for each object we pass into the Undo Manager into and in the Undo Paste class.  Voila!  Problem solved.

I suspect that FTC is big enough and complex enough to manifest some edge case for the 64-bit compiler.  If you run into an issue like this try this workaround.  And don’t forget to submit a Feedback report to Xojo since the more edge cases they can find the more likely it is they can determine the cause.

Happy Coding!

Formatted Text Control 3.1.9

BKeeney Software has released version 3.1.9 of the Formatted Text Control, a canvas based word processing control for Xojo Mac OS X and Windows applications. The FTC is an alternative to the built-in TextArea control and allows for in-line graphics, hyperlinks, custom components, better RTF support and much more. The demo project has quite a few examples, including a Masked Text Field, XojoScript code editor example, Embedded FTC (in your own canvas), as well as the word processor with page view.

This is a maintenance release and is free for all version 3 users.  It fixes the following items:

– Fixed issue with view scale < 1.0 setting up the clipping page incorrectly (#3500)
– Fixed spelling replace on TestWindow (#3581)
– Fixed Mac text AutoComplete positioning (#3574)
– Fixed Tabstop Widths (#3500, #3576)
– Updated Linux declare for doubleClickTime to include GTK3 in newer Xojo versions (#3575)
– Fixed the Draw Control border on the right side (#3473)
– Added SpellCheck configuration testing to contextual menu on TestWindow
– Added SpellCheck configuration testing to App.Close event
– Fixed resources directory location for the the Spell Checker initialization
– Added more comments in code if plugins are missing

The Formatted Text Control costs $150 and is 100% unencrypted Xojo code. Version 3 and above requires the use of the Text Input Canvas plugin (included in package) to allow for proper text handling in Cocoa builds. Product page at

FTC 3.1.7

black-fountain-penToday we released version 3.1.7 of Formatted Text Control (FTC), our word processor control for Xojo.  This is a maintenance release and is recommend for all users.  It is a free update for all version 3 license holders.

License holders should get an email from the BKS FileShare system.  If you don’t get an email, please contact us.

Changes in this release:

  • Fixed issues with Unicode Hyperlinks
  • Fixed Windows Compiler Issue
  • Fixed HIDPT coordinates issue issue with ConstructContextualMenu event handler
  • Added ability to detect Windows HiDPI (requires Xojo 2016 R2 or better.
  • TextInputCanvas plugin rebuilt to be 64 bit compatible.
  • Spell Checker demo plugin rebuilt to be 64 bit compatible

The Formatted Text Control is a canvas based control for Xojo that implements word processor capabilities similar to Apple Pages or Microsoft Word. The FTC is a canvas (technically Text Input Canvas) subclassed control  for Xojo that allows you to instantly add word processing capabilities to your applications.  More information, pricing, and demo at


Formatted Text Control 3.1.1

We released a new version of the Formatted Text Control today.  Version 3.1.1 is a general release after a long beta period.  This version finalizes the special key handling required by the new Text Input Canvas plugin as well as fixes a host of smaller issues that popped up because of using the new plugin.

For those that aren’t familiar with the Text Input Canvas, it’s the only way for canvas based controls to get the proper key input from the operating system in Cocoa applications.  In Carbon applications Apple Text Services from the Mac OS provided a lot of extra information but in Cocoa that information is only available to text handling controls.  Canvas based controls do not get that benefit so Xojo had to create and provide a plugin to do that.  With the plugin, special characters now input properly (such as é, ü, ç) as well as all of the odd keyboard handling key combinations (shift up/down/right/left arrows) now work.

FTC works in Xojo applications built for Mac OS X (Cocoa) and Windows.  Some users have gotten it to work in Linux but it is unsupported.  Version 3.0 and above work only in Xojo.  Real Studio developers should stick with version 2.

Version 3.1.1 is a free update to any version 3.x license owners.  An email going out from the FileShare system should already be in your inbox telling you about the new versions.

The Formatted Text Control costs $150 and comes with full unencrypted source code upon purchase.  Version 3 is a paid upgrade to version 1.x and 2.x version owners.  If you do not already have an upgrade coupon please contact BKeeney Software support.

More information regarding the Formatted Text Control may be found at


Formatted Text Control 3.1.0 Alpha 1

If you work with Canvas objects that need text handling in Real Studio/Xojo Cocoa builds you quickly realize that it works vastly different than in Carbon builds.  This is because Carbon apps (through Apple Text Services) gives you a bunch of information for free.  In Cocoa only text controls get that information and that presents some issues to Xojo developers creating custom controls that do keyboard handling.

The Formatted Text Control is a word processor control for Xojo that is based on a canvas subclass and it works in Cocoa – somewhat.  If you try to do any international characters such as é or ü you quickly discover it doesn’t work like it should.  This problem is not unique to just the FTC because the Xojo Code Editor is also based on a Canvas subclass.

Xojo released an open source plugin on Friday for those who want to create custom text controls with international support (and integration with some Cocoa features).  The plugin is available on GitHub for anyone to use.  That page is at and the direct download for the plugin is at (this may change soon).

Formatted Text.debugScreenSnapz001

We’ve been fortunate to work with Xojo Inc in getting the Text Input Canvas plugin for early testing and integration.  This plugin works on Mac, Windows, and Linux and adds a number of events to the canvas control that you have to implement to get it to work.  Among one of the more important events you now need to handle is the DoCommand event.  The OS passes in all of the keyboard events the could happen including arrow key movement, delete and backspace keys, and insert new line to name just a few of the possibilities.  If it’s actual text to be inserted (rather than cursor handling or selection changes) the InsertText event passes in the text as well as the range of the text.  Incomplete text (such as the é and ü) that requires multiple steps in Cocoa get inserted using the SetIncompleteText event.

The control itself then wants to retrieve some data that Cocoa needs by way of several events such as the IncompleteTextRange and SelectedRange events.  This allows the FTC to not only support international text in Cocoa but to also get use some OS level Cocoa goodies.  Hover the cursor over a word and then press Control + Command + d to see the definition of the word just like any other Cocoa app.

Unfortunately, the current download for the plugin doesn’t have much in the way of documentation for how the new events work and what is required for it to function in Cocoa.  This is unfortunate because it’s rather complex and we’ve spent a lot of time working with the plugin and with the Xojo engineers to get the FTC working properly (and we still have some things to work on).  I guess this means that the best example/documentation currently available is the Formatted Text Control.  Again, I expect this to change in the near future.

Today we are releasing FTC version 3.1 alpha 1 for Xojo.  Since this requires the use of the Text Input Canvas plugin this is a Xojo-only solution.  For those still on Real Studio you need to stick with version 3.  Version 3.1 is a free upgrade to anyone that already owns version 3.  All previous versions are eligible for a discounted upgrade.  If you do not have an upgrade coupon from us, please send us an email at support at bkeeney dot com.

If you already are on version 3.0 you should have received email notifications from our File Share application.

UPDATE:  I need to note that building for Carbon isn’t supported in FTC 3.1.  The new plugin is Cocoa, Windows, and Linux compatible.  If you’re building for Carbon you should continue to use version 3.0.

Formatted Text Control 3.0

For many developers the TextArea control that Real Software provides with Real Studio is more than adequate for their needs.  It provides basic StyledText support, spell checking for Cocoa (Mac OS X Only) builds, and limited Rich Text Format (RTF) support.  If you’ve ever wanted to do add graphics, you’re pretty much out of luck and it doesn’t look like Real Software will add support for graphics any time soon.

The Formatted Text Control (FTC) is our solution to the limits of the TextArea control.  It provides word processing capabilities in true WYSIWYG format similar to what Apple Pages and Microsoft Word provide.  It has three view modes to help control how the user interacts with their document.  It provides better (not complete, however) support for RTF, plain text, and XML document formats.

If the FTC doesn’t do exactly what you want it’s relatively easy to create your own special objects using the FTCustom class to provide practically anything your application needs.  We’ve used these capabilities in our consulting work to provide inline file references, inline tagging capabilities as well as database merging.  Really, your imagination is the only limit with these objects.  And, just to add some icing on the cake, you can easily save these custom objects to and from XML.

For true cross-platform spell checking it can also make use of the Spell Checking Utilities (SCU) plugin, also available from us at  The SCU uses the Wintertree spell checking library and they have additional languages and even medical and legal supplements.

We took over the FTC from the previous developer in July of last year and we’ve been busy updating it for version 3.  New in this version is Retina Display support for Cocoa builds and provides the crisp quality that many Mac users expect from their applications in the higher resolution.

Also new in this version is true hyperlink support.  In previous versions you could have fake hyperlinks using the FTCustom class but now it’s part of the internal StyleRun and can be read in and out of RTF documents.  In addition to that we added support for text opacity and text shadow to have even better control of your text.

We’ve done a little bit of custom development work for various clients that have made their way into this release as well.  We added AutoComplete support for those that want to offer their users shortcuts and hints to words they’ve already started typing.  This should be helpful for anyone that’s using the RBScriptEditor subclass or who makes heavy use of custom words.

Along the way we’ve rewritten the Undo Manager to allow for unlimited undo/redo.  We’ve rewritten the RTF Reader class to handle RTF input faster and cleaner.  Based on our own project needs we greatly enhanced the HTML Export functions so that it exports more style information and many other things including images and any FTCustom objects the developer might be using.

We also listened to what users were having problems with.  Many people found the big monolithic demo application too complicated so we created a number of smaller, more targeted demo applications that should hopefully make things easier for people to get started.  Also based on feedback we removed the dependency of the main demo application to have the Spell Checking Utilities (SCU) plugin installed and made a smaller Spell checking specific demo.

We are keenly aware that Cocoa is soon going to be the new normal for Real Studio builds and we’ve added more/better Cocoa support.  Not all is well in the land of Cocoa for us, however.  Text input handling is vastly different in Cocoa than in Carbon and there are major issues with accented characters in controls that weren’t designed for text input.  One of those is the Canvas control and currently the FTC, nor any other canvas control doing keyboard input in Cocoa builds, is able to capture nor detect accented characters.

Real Software has found a solution (since the IDE code editor itself is a canvas subclass) and we are working closely with them to modify the FTC to use this new solution.  The drawback is that it will require a plugin that eventually Real Software will release to the public sometime after 2013 Release 1.  I’ve been told that this plugin will be open sourced so that the community will be able to modify it as they need but so far there’s no timetable on that.

Switching to this plugin will require that developers using the FTC will need to have this plugin installed for it to work.  It’s a drag but there’s no way around it.  It also means that starting in version 3.1 of the FTC it will NOT be backwards compatible with older versions of Real Studio.  This plugin will ONLY  work with Real Studio 2013 Release 1 or better.  Again, not ideal and it’s possible that we will maintain multiple versions.

Formatted Text Control is $150 which gives you the entire source code base.  Nothing is encrypted so you have total control over it.  Existing users of the FTC (versions 1 or 2) are eligible to get version 3 at 50% off and should have received an email with the coupon code a week ago.  Contact support at BKeeney if you are an existing user that did not receive a coupon code.

For more information on the Formatted Text Control please visit  There you’ll find demo and documentation downloads as well as a full list of enhancements and changes in version 3.0

Busy Updating Products

I apologize.  Blog posts have been slow lately.  Acquiring products from another company is an interesting process and figuring out the StyledHTMLField and Simple Help Editor was no exception.  First, you have to get in the mind of the original developer and figure out what they were trying to do and then determine if you wish to change the code and then test, test, test.  I can say I am very thankful for source code control because I’ve broken a few (too many) things and had to revert to older code!

One of the things we’re doing with Simple Help Editor is changing the licensing scheme to fit most of BKeeney Software’s other commercial products.  That led me down the proverbial rabbit hole because we discovered that the eSellerate plugin works fine in Carbon and Cocoa (after contacting tech support to get the Cocoa update) but fails in Windows (go figure).  Of course this only happens in Real Studio 2012 R1 and higher so I’m sure it’s simply a plugin compatibility issue and hopefully we can get an update soon (because we’re waiting to release!)

The other thing we decided to do was move to our standard preferences system.  The reasoning was twofold:  First, it now works just like every other of our products so my and my team won’t have to think about what the preferences system does because we know it (and use it everywhere).  The second reason, which was kind of by accident but fortuitous anyway, was that we got to touch code everywhere.  Just by replacing the preferences we go to see a LOT of code we wouldn’t have normally touched.

Just by doing these two seemingly minor items I now have a whole laundry list of items I want to change in Simple Help Editor.  Some of it is personal preference and some of it is features I want for my own products.  It’s also a strong possibility that we’ll integrate the Formatted Text Control into Simple Help Editor to not have to rely upon the RTF to HTML conversion routines and the built-in TextArea control which doesn’t allow any graphics to be shown.  This should make the Simple Help Editor text editors to be a bit more intuitive.  If you are are user of Simple Help Editor and have a feature request then please let me know.  I

Speaking of the Formatted Text Control we’re also working on it too and getting it ready for new features in version 3.  Among the planned features are Retina display support, HTML Export, Hyperlink support, and adding a number of simpler examples that developers can (hopefully) use out of the box without any plugins.

Sometimes I am amazed at how long some things seem to take.  I guess I shouldn’t at this point as I come up with estimates for clients all the time.  When it’s my own stuff it seems to take FOREVER to get done.

Anyway, that’s the current update.  Thanks for you patronage and continued support!