The Impossibility Of The Centred Line

Interoperability is good, and breaks down the walls of walled gardens, but it isn't always possible for every feature to be interoperable, as I discovered decades ago writing import filters for a word-processor.

It turns out there are very good reasons why not all word-processors are capable of all functions. Internal data structures — the “document model” — are likely to be designed to reflect the way a word processor manipulates the document.

There are many different approaches to manipulating documents. One approach is to treat the document as an optimal sequence of keystrokes or events to create the document. Another approach is to treat the document as a set of layers superimposed on an earlier version to produce the current version. Another approach is to describe the document in terms of its abstract layout and then apply a “style sheet” later that defines how to display or print the document. These descriptions are greatly simplified and there are many more approaches.

The result of this diversity is there may well be data structures used by one word processor (and thus their file formats) which have no equivalent expression in the code of another word processor. So for example one very old word processor which worked a lot like a typewriter — WordStar — included the option to type a keystroke that resulted in the line containing that keystroke being centred on the page, without affecting the flow or alignment of the adjacent lines even if they were part of the same continuous paragraph.

It worked because it was treating the document as a character stream. When WordStar saw the command to “centre a line” it centred the current line it was displaying or printing. But subsequent word-processors, even those written at the time (such as WordPerfect) used a different document model. As a result this effect has proved impossible to implement in most subsequent word processors, so when a file from that early system is loaded today, even assuming there is an import function for it, the “centre line” keystroke is typically discarded when encountered.

(Adapted from an original post to a test-blog on 27-Jun-22)

To discuss this post please reply from Mastodon etc. (search for the URL) & include as WriteFreely still doesn't display replies. More.