TAML a Text Area Markup Languge
Steve Drain (222) 1620 posts |
This is a trivial thing, that may have little practical use, but it has kept me amused for a week or so. The recent topic on Svg2Draw, in which I had a go at transforming whole DrawFiles, and also a couple of recent questions about displaying text in a window, brought back into my mind the Text Area (TA), that unloved and possibly unused, member of the Draw object family. The effects that are provided for TAs are actually quite powerful, but implementing them in any but simple ways is not that easy. The TA markup was invented some time before HTML and other markup languages, and it is not oriented to what we now expect. Nor do I find the description in the PRM all that friendly. TAML is a BASIC utility that takes a text file with a simple markup, akin to HTML, and produces a DrawFile containing a single group, comprising Text Area and a background rectangle. TAML can also be used as a library within a program to handle everything in memory. Currently the tags include font family, bold, italic and underline, superscript and subscript, alignments, leading, colour and horizontal rule. More may follow All tags can be nested. A TAML TA object can be used wherever a DrawFile can be used, especially in a window. Using DrawFile_Render it can be transformed, so rotated, although there are problems with this. Quite elaborate text can be produce this way without using a single Font or Colour SWI, but there is no possibility of editing, of course. TAML is very much experimental, but if you are interested and might have a contribution it can be downloaded at: http://www.kappa.me.uk/Miscellaneous/swTAML001.zip. |
Clive Semmens (2335) 3276 posts |
Interesting, Steve – will take a look. Not that I’ve ever used text areas, in all my many years of using !Draw (ever since it first appeared, indeed). And none of my (several) programs for doing rude things to DrawFiles have ever attempted to do anything with text areas, either… |