image 1

Ted, a rich text editor


Ted is a text editor running under Motif on Unix/Linux systems. Ted was developed as an operating system accessory like Wordpad on MS-Windows. In our opinion, the possibility to type a letter or a note on a Unix/Linux machine is clearly missing. Only too often, you have to turn to a Windows machine to write a letter or an e-mail message. Ted s function is to be able to edit rich text documents on Unix/Linux in a wysiwyg way.

Compatibility with popular MS-Windows applications played an important role in the design of Ted . Every document produced by Ted should be accepted as a legal .rtf file by Word , without any loss of formatting or information. Compatibility in the other direction is more difficult to achieve. Ted supports most basic text formatting, as supported by the Microsoft applications. Other formatting instructions and meta information are ignored.*) By ignoring unsupported formatting Ted tries to get the complete text of a document on screen. Ted can be used to read formatted e-mail sent from a Windows machine to Unix. Below we explain how to configure Ted as an RTF viewer in Netscape.

I hope that you will find Ted useful.

*) Most of the ignored information is not saved either when you modify and then save an RTF document with Ted .


· Wysiwyg rich text editing. You can use all fonts for which you have a .afm file and that are available as an X11 font. Ted is delivered with .afm files for the Adobe fonts that are available on Motif systems and in all postscript printers: Times , Helvetica, Courier and Symbol. Other fonts can be added with the normal X11 procedure. Font properties like bold and italic are supported; so is underlining.

· Ted uses Microsoft RTF as its native file format. Microsoft Word and Wordpad can read files produced by Ted . Usually Ted can read .rtf files from Microsoft Word and Wordpad . As Ted does not support all features of Word, some formatting information might be lost.

· In line bitmap pictures.

· Postscript printing.

· Spelling checking in several Latin languages. (English, Dutch, German, Portuguese; In the free Linux versions also French and Spanish.)

· Directly mailing documents from Ted .

· Cut/Copy/Paste, also with other applications.

· Find/Replace.

· Ruler: Paragraph indentation, Indentation of first line, Tabs. Copy/Paste Ruler.

· Page breaks.

· Tables: Insert Table, Row, Column. Changing the column width of tables with their ruler.

· Symbols and accented characters are fully supported.

· Hyperlinks.

· Saving a document in HTML format.

How to install Ted

Log in as root, mount the CD and run sh from the directory for your platform on the CD. If you do not like installation scripts, you can unpack the compressed files manually. This manual file, it is on the CD as readme.rtf. Text and HTML versions are available as readme.txt and readme.html.

The contents of the CD are also available from Erreur! Signet non défini.

Configuring Ted

Texts and default settings of Ted are configurable through the habitual X11 application resources mechanism. Ted does not use documented widget names, so no widget resources can be set using the widget resources mechanism*). Refer to the file /usr/local/info/ for a commented example file. To overrule the default values of the resources that are compiled into Ted, install the lines you change in this file as a $HOME/Ted file. If you do not want a visible file in your home directory include the changed lines in $HOME/.Xdefaults.

Most settings relate to the texts of the different controls on the windows. These are not covered in this introductory manual. Refer to the file for an explanation.

The following properties influence Ted s functionality:

Ted.defaultFont: Used as the font of new documents. The format of the string is: <Family>,<Weight>,<Slant>,<Size>

Ted.magnification: Magnification for drawing documents on the screen. The default value is 1.2 for 120%.

Ted.unit: The unit that is used by default. This resource influences the appearance of the ruler and the interpretation of numbers entered in the page layout tool. Possible values are: inch,",cm,mm,points,pt,picas,pi.

Ted.paper: The paper format that is used for new documents. Possible values are: a4,a5,letter,legal,executive and strings of the form <Width> x <Height> where <Width> and <Height> are valid dimensions. Valid dimensions are strings of the form <Number> <Unit>. Values for units are given above. If <Unit> is omitted, the value of the 'unit' resource is assumed.

Ted.leftMargin: The width of the left margin of a new document. The value must be a valid dimension.

Ted.rightMargin: The width of the right margin of a new document. The value must be a valid dimension.

Ted.topMargin: The height of the top margin of a new document. The value must be a valid dimension.

Ted.bottomMargin: The height of the bottom margin of a new document. The value must be a valid dimension.

Ted.mailContent: The default content type for mail messages. The default is text/plain. Possible values are the resource names for the menu options. I.E. mailPlain,mailRtf,mailHtml.

Ted.mailFrom: The default sender of the mail messages. No default value exists, but if none is given, the mailing software attempts to compose a name like 'Your Name <login@host.domain>'.

Ted.mailHost: The SMTP relay that is used to transmit your mail. The default is 'localhost'.

*) Exceptions are made for the Shell widgets. With window managers different from mwm , it might be necessary to set Geometry resources for them. The names of the Shell widgets are given below.

How to use Ted as a Netscape helper application

In Netscape 4.0 choose Edit, Preferences.., Navigator, Applications. Click on 'Rich Text Format', then on the 'Edit' Button. In the 'Application:' Edit box enter '/usr/local/bin/Ted %s'

image 2

Text and text attributes

To enter text, just type. What you type is inserted in the text before the insertion point that is shown as a blinking vertical line. If a region of text is selected, the whole selection is replaced by what you type. Single letters can be deleted with the backspace key. It deletes the character before the insertion point. The Delete key deletes the character after the insertion point. If a region of text is selected, both the Backspace and Delete keys delete the selection.

The insertion point can be moved with the arrow keys, or by clicking with the left mouse button in the desired position. Regions of text can be selected by dragging over the text with the left mouse key down. Ted shows you what is selected by drawing the background of the selected region in light blue.

To change the font of the selected region, activate the Font tool by clicking the 'Font Tool' option in the 'Font' menu. It shows you the font of the current selection. Choose the font you want to use for the selection in the Font Tool and push the 'Set' button. With the 'Preview' button of the Font Tool, you can inspect the font before you select it. With the 'Revert' button, you can adapt the Font Tool to the selected region again.

To change single text attributes such as 'Bold', 'Italic' and 'Underlined' , you can also use the options in the 'Font' menu.

The following illustration shows the Font Tool.

image 3

Paragraphs and the ruler

A paragraph is a piece of text that is folded between the margins of the page. Explicit line breaks separate paragraphs. With the 'Paragraph on New Page' menu option, paragraphs can be made to start on a new page when the text is printed.

Between the margins of the page. Every paragraph of a text has a ruler. The ruler is shown at the top of the editing window. It defines some properties of a paragraph.

· The left indentation of the first line of the paragraph: The place to the right of the left margin of the page where the first line of the paragraph begins. The indentation of the first line is shown by the button above the white band of the ruler.

· The left indentation of the rest of the paragraph: the place to the right of the left margin of the page where the other lines of the paragraph begin. The left indentation of the paragraph is shown by a button below the white band of the ruler.

· The right indentation of the paragraph: The width of the band to the left of the right margin of the page, that shall not be used by the paragraph. The right indentation of the paragraph is shown by a button below the white band of the ruler.

· A series of tab stops. Tab stops are shown as little brackets in the white band of the ruler. In the absence of explicit tabs, or right of the rightmost tab, implicit tab stops every half inch are used for text formatting.

The position of the different indentations and the tabs can be changed by dragging the controls on the ruler that represent them. Tabs can be set by clicking on the white band of the ruler. Tabs can be removed by dragging them from the white band.

Rulers can be remembered with the 'Copy Ruler' menu option. It remembers the ruler of the paragraph that contains the insertion point in the text. If a region of text is selected, the ruler of the paragraph where the selection begins is remembered. Remembered rulers can be applied to other paragraphs. The 'Paste Ruler' Menu option sets the remembered ruler for the paragraph that contains the insertion point. If a region of text is selected, the remembered ruler is set for all paragraphs that contain part of the selection.

The following illustration shows a paragraph and its ruler.

image 4


You can include pictures in your texts. To do so select the Include Picture option in the Edit menu. A file chooser will allow you select a picture file to include in your text. The most frequent picture files such as tiff, bmp, xwd and jpeg are supported. It is also possible to paste pictures from other X11 applications.

To resize a picture double click it with the left mouse button. Eight resize squares will appear. Dragging the squares on the bottom or on the right resizes the picture. The following is a picture during the resize process.

image 5


Ted supports Copy/Paste with itself and with other X11 applications. With the 'Copy' menu option, you can remember a piece of text or a picture. The 'Paste' menu option allows you to paste the remembered text to a different location of the same document, or to a different document.

Copy/Paste of formatted text is only supported between Ted texts *). String text with elementary formatting such as tabs and newlines can be exchanged with most X11 applications.

Copy/Paste of pictures, retaining geometry information is supported between Ted windows, and between Ted and Scan #). Copy/Paste is also possible with picture oriented X11 applications that support the exchange PIXMAP selections. With those applications, scaling information is lost.

*) Theoretically other applications might support it: selection=PRIMARY, target=RTF; the contents of the window property that is exchanged is a complete rtf document.

#) Theoretically other applications might support it: selection=PRIMARY, target=PNG; the contents of the window property that is exchanged is a complete png picture.

Including symbols and accented characters

To include special symbols into a text you can use the symbol picker tool. To activate it, choose 'Include Symbol' in the 'Edit' menu or in the 'Tools' menu. The symbol picker shows all characters available in the current font. You can either select a symbol, and then push the 'Insert' button, or double click the desired symbol. Symbols from different font families can be selected with the font chooser above the symbols.

image 6

Common accented characters can be typed directly. If your X11 server is correctly configured, the local input method that is compiled into the X11 libraries supports a compose key. The <compose> key allows you to insert accented characters by typing <Compose> <Letter> <Accent> or <Compose> <Accent> <Letter>. Where <Accent> is an ascii character that resembles the intended accent. E.G. <Compose> a ' results in á. Another example: <Compose> 1 2 results in &frac12;. Refer to the paragraph on X11 configuration for some further remarks.

Sending mail from Ted

You can mail the text that you are typing directly from Ted. Choose Mail.. in the File menu. The following dialog appears.

image 7

Enter a subject and the various kinds of recipients in the text fields *). Enter your mail address in the 'From' text field, or refer to the paragraph on configurable resources to find out how to set a default value for From.

Choose a content type. Do realize that only Microsoft users and people with Ted on their machine will be able to read mail in RTF format. Do realize that only people that read their mail with web browsers will be able to read mail in HTML format. So if you do not know your recipient, it is best to send your mail in plain text format. Refer to the paragraph on configurable resources if you want to configure a default content type for your mail.

*) Cc (Carbon Copy) recipients will get the mail, and they will be mentioned in the headers of the mail message.

Bcc (Blank Carbon Copy) recipients will also get the mail, but they will not be mentioned in the headers of the mail message.


To change a text region into a hyperlink, select the text, choose the 'Hyperlink..' option from the 'Edit' menu and enter the destination of the link in the 'Hyperlink..' dialog. The 'Hyperlink..' dialog can also be used to change, remove and follow links. Hyperlinks are particularly interesting when the text is saved to HTML.


Apart from the French and the Dutch material, the spelling dictionaries are derived from ispell dictionaries. I only use the dictionary and the affix files. My checker is based on finite automata, not on hashing. The author of the original ispell program and the source of the idea of affix files was Geoff Kuenning. ispell is available from GNU and from ( The US and British dictionaries stem from the ispell material. Geoff Kuenning was so kind to allow me to use the ispell dictionaries.

· The German ispell material is that of Heinz Knutzen. It is available as Heinz Knutzen was so kind to allow me to use his ispell dictionary.

· The Spanish ispell material is that of Santiago Rodríguez and Jesús Carretero, Universidad Politecnica de Madrid. It is available as

· The Portuguese ispell material is that of Ulisses Pinto & José João Almeida, Universidade do Minho. It is available as ftp:// José João Almeida was so kind to allow me to use his ispell dictionary.

· The French material is that from Paul Zimmermann, Inria Lorraine. It is available as Paul Zimmermann was so kind to allow me to use his dictionary in free copies of Ted.

· The Dutch spelling material was derived from that of Jan van Bakel, Dick Grune and Patrick Groeneveld. I added a lot of words and adapted the material to the new orthography rules. The original material is available as

Searching for regular expressions is done with an adapted version of the regex library by Henry Spencer, University of Toronto. Most of the adaptations were more about C programming than about the functionality. I added routines for reverse searching. (Find Previous). The original source is available as

The possibility to directly send mail from Ted is based on code by my friend and colleague Rob Vonk.

For some types of picture files, public source code was used.

· Support for TIFF pictures is implemented with Sam Leffler's libtiff that is available from

· Support for PNG pictures is implemented with the PNG groups libpng. Source is available on in the directory /graphics/png.

· Support for JPEG pictures is implemented with the Independent JPEG groups libjpeg. It is available from in the directory graphics/jpeg.

· Support for XPM pictures uses libXpm by Arnaud Le Hors of Groupe Bull. Source is available from

· Support for GIF pictures was borrowed from libgif by Gershon Elber and Eric S. Raymond. For more information refer to the giflib home page:

The picture of a writing schoolboy on the application window is the lower right corner of a woodcut by Albrecht Dürer dated 1510. It represents a schoolmaster teaching a class of children. Its motto is: Wer recht bescheyden wol werden, Der pit got trum bye auff erden.

Using window managers different from mwm

Ted was developed as a Motif application. Most of the testing has been done with the Motif Window Manager. When you use a different window manager, please note the following:

· Window managers like fvwm do brute things like killing an X11 application. Ted is not immune to physical violence.

· Window managers that require you to interactively place windows can be a nuisance. It might be necessary to give Geometry resources that give the windows a fixed position and a fixed size. Specifying Ted*Geometry applies to all windows. Use the names below to give the geometry of the different windows.

Shell widget names

With window managers different from mwm , it might be necessary to set Geometry resources for Shell widgets. Shell names are given below.

Application window Ted

Document window tedDocument

Find Tool tedFindTool

Spell Tool tedSpellTool

Font Tool tedFontTool

Page Layout Tool tedPageTool

Insert Symbol Tool tedSymbolPicker

Hyperlink Dialog tedHyperlink *)

Print Dialog tedPrintDialog *)

Mail Dialog tedMailDialog *)

Message Dialog tedMessageDialog *)

*) Generally no Geometry resource needed.

Remarks about X11 server configuration, accented characters and backspace

The local input method that is compiled into the X11 libraries supports a compose key. Sometimes it is not configured; sometimes you have to try many keys before you find it. In older versions of Xfree386, the compose (Multi_key) is the one labeled ScrollLock on American keyboards. In newer versions, it is no longer configured. By inserting a line like xmodmap -e 'keycode 78 = Multi_key' in your private .xinitrc file, you can configure a compose key.

Sometimes, no BackSpace key is configured in X11. All keys that backspace are configured as Delete keys. If pushing the backspace key deletes the character after the I-Bar, configure a BackSpace key. In Xfree386 this can be done with the command xmodmap -e 'keycode 22 = BackSpace'

Similar remarks apply for other X11 versions.

Ted for Linux

Ted is free software. By making Ted freely available, I want to contribute to the propagation of Linux as a viable platform for technical computer enthusiasts. As Ted is free software, I assume no responsibility for the consequences of using it. It is up to you to decide whether Ted suits your purpose or not. Ted is distributed with no warranty under the terms of the Erreur! Signet non défini. .


Those that do not have a postscript printer can use the excellent postscript emulation package ghostscript. It is available from in the directory ghost. Aladdin Ghostscript and GNU Ghostscript offer excellent postscript emulation on a variety of printers.


Mark de Does

image 8