<IMG>
 
Ted, an easy rich text processor
 
Introduction
Features
Ted for Linux: copyright and disclaimer
How to invoke Ted
How to install Ted
The rtf file format
Text and text attributes
Pictures
Including symbols and accented characters
Copy/Paste
Finding and Replacing Text
Spell checking
Hyperlinks and bookmarks
Paragraphs and the ruler
Paragraph borders and shading
Tables
Sections
Footnotes and Endnotes
Page Headers, Page Footers and Page Numbers
Page Size and Page Margins
Bullets and Numbering
Choosing colors
Printing from Ted, writing PostScript and Acrobat PDF
Saving documents to HTML and to plain text
Sending mail from Ted
How to use Ted as a mime handler or a Netscape helper application
Command line arguments
Configuring Ted
How to use Ted in your language
Using more fonts with a Ted installation
Uploading fonts to a PostScript printer
Nuisances with Window Managers
Shell widget names
Remarks about X11 server configuration, accented characters and backspace
Compiling Ted from source
Making spelling dictionaries for Ted
Acknowledgments
Author
 
1) Introduction
Ted is a word processor running under X Windows on Unix/Linux systems. Ted was developed as a standard easy word processor, having the role of Wordpad on MS-Windows. Since then, Ted has evolved to a real word processor that still has the same easy appearance as the original. The possibility to type a letter, a note or a report on a Unix/Linux machine is clearly missing. Only too often, you have to turn to MS-Windows machine to write a letter or a document. Ted was made to make it possible to edit rich text documents on Unix/Linux in a wysiwyg way. Ted is a simple standalone program to edit RTF files. It is not part of an office suite that can do about anything. RTF files from Ted are fully compatible with MS-Word. Additionally, Ted also is an RTF to PostScript and an RTF to Acrobat PDF converter.
 
Compatibility with popular MS-Windows applications played an important role in the design of Ted. Every document produced by Ted fully compatible with MS-Word without any loss of formatting or information. Compatibility in the other direction is more difficult to achieve. Ted supports many of the formatting features of the Microsoft applications. Other formatting instructions and meta information are ignored.1 By ignoring unsupported formatting Ted tries to get the complete text of a document on screen or to the printer. Ted can be used to read formatted e-mail sent from a Windows machine to Unix, to print an RTF document, or to convert it to Acrobat PDF format. Below we explain how to configure Ted as an RTF viewer in Netscape and how to convert an RTF document to PDF with Ted and GhostScript.
 
 
I hope that you will find Ted useful. Please report the bugs you find, such that I can fix them.
 
 
2) Features
·
Wysiwyg rich text editing. You can use all fonts for which you have an .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 and are subscripts and superscripts. 
·
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 and windows metafile pictures. 
·
PostScript printing of the document and its illustrations. Saved PostScript files contain pdfmarks that are converted to hyperlinks when they are converted to Acrobat PDF. 
·
Spelling checking in twelve Latin languages. 
·
Directly mailing documents from Ted. Mail in HTML format is a multipart message that contains all images hyperlinks and footnotes. 
·
Cut/Copy/Paste, also with other applications. 
·
Find/Replace. 
·
Ruler: Paragraph indentation, Indentation of first line, Tabs. Copy/Paste Ruler. 
·
Page breaks. 
·
Page headers and footers. Page numbers in page headers and page footers. 
·
Tables: Insert Table, Row, Column. Changing the column width of tables with their ruler. 
·
Symbols and accented characters are fully supported. 
·
Hyperlinks and bookmarks. 
·
Footnotes and endnotes. 
·
Colored backgrounds and table borders. 
·
Saving a document in HTML format. 
·
Probably the best illustration of what you can do with Ted is its documentation that has been made with Ted. 
 
This is the documentation for Ted 2.17. Release Notes with a change log are in a separate document.
 
3) Ted for Linux: copyright and disclaimer
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 absolutely no warranty under the terms of the GNU Public License. If you include Ted on a CD-ROM or any other medium, or publish Ted in any other way, it would be nice to tell me. Please send me a copy of your publication or a reference. I like to see what happens to Ted and to show off to my friends. You should not publish Ted or software that is based on Ted without mentioning me as the original author in all textual documents that accompany your software. If you publish Ted, or any piece of software that is based on Ted, you must include a copy of the original Ted documentation in your distribution. The Ted documentation is part of the source code that you have to make available to respect the GPL.
 
4) How to invoke Ted
Ted is an X11 program. To start it just invoke Ted & or /usr/local/bin/Ted &. To start Ted with a certain file invoke Ted something.rtf &. Several special purpose calls of Ted are documented below.
 
5) How to install Ted
The installation of Ted depends on the platform and on the kind of distribution. Binary distributions for Intel ix86 Linux are available from the download site ftp://ftp.nluug.nl/pub/editors/ted. The distribution comes in the form of compressed tar archives and as Red Hat package manager (RPM) packages. Binary distributions for other platforms might be available on CD. For more or more recent information refer to the Ted web site http://www.nllgg.nl/Ted.
 
To install Ted or one of the localization packages from an RPM package, log in as root, (Or any system user with sufficient permissions to install packages.) and give the command rpm -i <package-details>.rpm . To upgrade from a previous version of Ted give the command rpm -U <package-details>.rpm. The executable in the binary package is linked statically, so there are no dependencies on shared libraries. If you like shared libraries and their intricacies, you will have to compile Ted yourself.
 
Installation from compressed tar archives is best done in combination with the corresponding Linux Software Map (LSM) files and the installation script installTed.sh. Download the files to a scratch directory such as /tmp; log in as root; run sh installTed.sh from this directory. If you do not have the possibility to log in as root, you can run the command sh installTed.sh PRIVATE.After a private install the install script tells you what to include in your .Xdefaults or .Xresources file to make the installation work. (The root requirement is to have sufficient permission to create the files and directories. Any system user with sufficient permission will do.)
 
If you do not like easy installation, you can unpack the compressed tar archives manually. The software assumes that you do so in /usr/local. The Adobe font metric files are stored in /usr/local/afm and spell checking dictionaries in /usr/local/ind. This online document is installed as /usr/local/Ted/TedDocument-en_US.rtf. The example application resource file Ted.ad.sample is installed in /usr/local/Ted. If you decide to install Ted in a different location, you can change these locations by setting X11 resources, e.g. in your .Xdefaults or .Xresources file. Refer to the section on configuration below. Do not forget to call umask 0 before you unpack. Some of the localized packages contain translated documents that are installed as /usr/local/Ted/TedDocument-eg_ER.rtf. If you install by hand, the translated messages can be found in a /usr/local/Ted/ad/Ted_eg_ER.ad.tar with the app_defaults file for X11. The script and the rpm file install the app_defaults file automatically. Refer to the paragraphs on configuring and on translating Ted for more detailed information.
 
It is also possible to compile Ted from source. Refer to the compilation instructions at the end of this document.
 
Overview of the different packages:
 
Package
RPM package: file
Tar archive, LSM file
Basic binary package for Intel Linux. (Includes American spelling)
ted:
ted-2.17-1.i386.rpm
Ted_2.17_Linux_ix86.tar.gz, Ted_2.17_Linux_ix86.lsm
Install script for Tar archives and LSM files
 
installTed.sh
Dutch spelling and messages
ted_nl_NL:
ted_nl_NL-2.17-1.noarch.rpm
Ted_NL_nl.tar.gz, Ted_NL.lsm
British spelling
ted_en_GB:
ted_en_GB-2.17-1.noarch.rpm
Ted_en_GB.tar.gz, Ted_en_GB.lsm
German spelling and messages.
ted_de_DE:
ted_de_DE-2.17-1.noarch.rpm
Ted_de_DE.tar.gz, Ted_de_DE.lsm
Spanish spelling and messages
ted_es_ES:
ted_es_ES-2.17-1.noarch.rpm
Ted_es_ES.tar.gz, Ted_es_ES.lsm
Argentinian Spanish spelling and messages
ted_es_AR:
ted_es_AR-2.17-1.noarch.rpm
Ted_es_AR.tar.gz, Ted_es_AR.lsm
Portuguese spelling
ted_pt_PT:
ted_pt_PT-2.17-1.noarch.rpm
Ted_pt_PT.tar.gz, Ted_pt_PT.lsm
Brazilian Portuguese messages
ted_pt_BR:
ted_pt_BR-2.17-1.noarch.rpm
Ted_pt_BR.tar.gz, Ted_pt_BR.lsm
French spelling and messages.
ted_fr_FR:
ted_fr_FR-2.17-1.noarch.rpm
Ted_fr_FR.tar.gz, Ted_fr_FR.lsm
Italian spelling and messages
ted_it_IT:
ted_it_IT-2.17-1.noarch.rpm
Ted_it_IT.tar.gz, Ted_it_IT.lsm
Czech spelling and messages
ted_cs_CZ:
ted_cs_CZ-2.17-1.noarch.rpm
Ted_cs_CZ.tar.gz, Ted_cs_CZ.lsm
Danish spelling and messages
ted_da_DK:
ted_da_DK-2.17-1.noarch.rpm
Ted_da_DK.tar.gz, Ted_da_DK.lsm
Swedish spelling
ted_sv_SE:
ted_sv_SE-2.17-1.noarch.rpm
Ted_sv_SE.tar.gz, Ted_sv_SE.lsm
Norwegian spelling and messages
ted_no_NO:
ted_no_NO-2.17-1.noarch.rpm
Ted_no_NO.tar.gz, Ted_no_NO.lsm
Polish spelling and messages
ted_pl_PL:
ted_pl_PL-2.17-1.noarch.rpm
Ted_pl_PL.tar.gz, Ted_pl_PL.lsm
Slovak spelling and messages
ted_sk_SK:
ted_sk_SK-2.17-1.noarch.rpm
Ted_sk_SK.tar.gz, Ted_sk_SK.lsm
Hungarian messages
ted_hu_HU:
ted_hu_HU-2.17-1.noarch.rpm
Ted_hu_HU.tar.gz, Ted_hu_HU.lsm
Malagasy messages and manual
ted_mg_MG:
ted_mg_MG-2.17-1.noarch.rpm
Ted_mg_MG.tar.gz, Ted_mg_MG.lsm
Source2
ted:
ted-2.17-1.src.rpm
ted-2.17.src.tar.gz
Original Documentation and Release Notes
 
TedDocument-en_US.rtf
TedDocument-en_US.html
TedDocument-en_US.pdf
announce.html
Translated Documentation
 
TedDocument-de_DE.rtf
TedDocument-de_DE.html
TedDocument-de_DE.pdf
TedDocument-fr_FR.rtf
TedDocument-fr_FR.html
TedDocument-fr_FR.pdf
TedDocument-mg_MG.rtf
TedDocument-mg_MG.html
TedDocument-mg_MG.pdf
Spelling dictionary examples.3
 
tedSpellExamples.tar.gz
rtf to pdf script
rtf to PostScript script
 
rtf2pdf.sh.
rtf2ps.sh
Translated resource files for translators and those that like to install them by hand.
 
Ted_cs_CZ.ad
Ted_da_DK.ad
Ted_de_DE.ad
Ted_es_ES.ad
Ted_es_AR.ad
Ted_pt_BR.ad
Ted_fr_FR.ad
Ted_hu_HU.ad
Ted_it_IT.ad
Ted_nl_NL.ad
Ted_sk_SK.ad
Ted_no_NO.ad
Ted_pl_PL.ad
Ted_mg_MG.ad
Ted.ad.sample
 
For languages that use the Latin 2 character set, fonts that support the Latin 2 character set are best. Recent version of the URW++ fonts that come with GhostScript are more than satisfactory. Refer to the section on fonts to learn how you can tell Ted to use them by default.
 
A collection of Ted packages for the NetBSD operating system is available via ftp://ftp.netbsd.org/pub/NetBSD/packages/pkgsrc/editors/ted/README.html.
A french translation of Ted by Jean Peyratout can be found on the page http://www.abul.org/education/ted.php3. Axel Schwarzer ported Ted to some Unix versions. His ports can be found via http://pweb.uunet.de/schwarzer.d/.
 
6) The rtf file format
Ted uses rtf as its native file format. I have chosen the rtf format because it is an old file format that is understood by many text processing programs. The fist version of the microsoft RTF file format specification dates from 1987 and rtf has since then become the lingua franca for document exchange between word processors on the Apple Macintosh and on other computers: Many applications can understand rtf files and most people have a program that can render rtf installed on their computer. Not only word processors like Microsoft Word, Abi Word and Open Office, but also standard programs operating system programs like WordPad, TextEdit and write.exe understand the rtf file format. This makes rtf a good file format to reach a heterogeneous audience with many different computers and operating systems. From its origin, rtf has been a Microsoft file format. Some of us may fear that the legions of evil will infest his computer once he begins to use it. In practice however, it is a good simple portable file format. If it were formally standardized, it could be seen as an open standard for simple word processing documents.
 
As the Microsoft Word export file format, rtf describes Word documents. The current rtf 1.7 specification covers most of the functionality of MS-Word 2002. This does not mean that a program that reads and writes rtf has to be as elaborate as Microsoft Word. In fact almost no software that reads and writes rtf is as elaborate as Microsoft Word. Almost any application that reads rtf files [including Ted] silently ignores unknown rtf control words. This even applies for MS-Word itself. The result is that no two programs write exactly the same rtf variant and that many consciously designed and accidentally born rtf dialects exist. Examples of accidental variants are the typo \fc tag for \cf on the NextStep platform ten years ago or the recent \nobrdr tag in Open Office that seems to mean the same thing as \brdrnone in the specification. [I ignore the fact that \brdrnone is only mentioned, not explained in the Microsoft rtf specification.] An example of consciously designed deviations are the {\*\pgdsctable and {\pgdscN groups that Star Office emits. Sun could be excused for this because everything is an a {\*\something group. The fact that the tags are undocumented is inexcusable however.
 
The rtf file format is relatively well documented. Every few years, Microsoft issues a fresh specification that matches a recent version of MS-Word. The latest version that I have seen is the rtf 1.7 specification. It corresponds to MS-Word 2002. The location on the Microsoft site changes all the time. The easiest way to find the document is to search for "Rich Text Format (RTF) Specification" with Google. (Note the double quotes.) Though the document gives many details of the file format and all the rtf control words, the the meaning of the control words is only concisely explained. The O'Reilly RTF Pocket Guide by Sean M. Burke is a good introduction to rtf and a valuable companion to the Microsoft file format document.
 
One of the more annoying differences between rtf dialects that I have encountered is the way page headers are emitted in Open Office and Star Office. As the rtf that the two emit really means something different in MS-Word and Ted, it is impossible to make a work-around in the Ted source. The simple example shell script below fixes rtf documents that do not show the correct headers in Ted.
 
IN=sample.rtf
OUT=ss.rtf
 
sed -e 's/^{\\headerf/\\titlepg{\\headerf/' \
-e 's/^{\\headerl/\\facingp{\\headerl/' \
-e 's/^{\\headerr/\\facingp{\\headerr/' \
-e 's/^{\\footerf/\\titlepg{\\footerf/' \
-e 's/^{\\footerl/\\facingp{\\footerl/' \
-e 's/^{\\footerr/\\facingp{\\footerr/' \
-e 's/\\nobrdr/\\brdrnone/g' $IN > $OUT
 
7) 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. If the backspace key deletes the text after the insertion point, your X11 configuration wants it to be a Delete key. Refer to the section on X11 configuration below for details.
 
The insertion point can be moved with the arrow keys, or by clicking with the left mouse button in the desired position. The 'Home' key moves the insertion point to the beginning of the line. The 'End' key to the end of the line. Regions of text can be selected by dragging over the text with the left mouse key down. It is also possible to select regions of text with one of the keys that moves the insertion point: Press the key while the shift key is down. Ted shows you what is selected by drawing the background of the selected region in light blue. The same applies for mouse clicks with the shift key down: The selection is extended to the position of the click. In general, navigation commands with the shift key down extend the selection. Selections inside tables remain inside the contents of one table cell or select a rectangular range of complete cells.
 
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. If you select a single font in the Font Tool, its name is shown in the selected font. The description of a multiple font selection is shown in one of the fonts selected. With the 'Revert' button, you can adapt the Font Tool to the fonts in the selected region again.
 
The 'Copy Font' and 'Paste Font' menu options make it easy to use the same text attributes in different parts of your text. Select a position with the font you want to use somewhere else and click the 'Copy Font' option. Then select a region of text and click the 'Paste Font' option. The selected region gets the text attributes that you have copied from the first position.
 
The collection of fonts that Ted can use is determined by the collection of something.afm files in the Ted afm directory. (default: /usr/local/afm) Only fonts that have a metrics file there can be used. Ted uses certain heuristics based on the name of the font family and the font attributes to find an X11 font with a postscript font. Refer to the section on adding fonts for a mechanism to explicitly associate X11 fonts with PostScript fonts. Only those fonts for which an X11 font can be found can be used from Ted. Note that for fonts in a character set different from the Latin 1 character set, the AFM file, the X11 font and the printer font should have the correct encoding. Refer to the section on fonts for more details. Ted tries to reencode fonts in an encoding that that if believes to be the most suitable. In general, Ted tries to find supported character sets in the afm file of a font and to use the font in a standard encoding. Fonts that do not have all characters of any of the character sets supported by Ted are only grudgingly accepted: Ted issues a warning and in many cases the result is far from optimal. Note that the afm files tell Ted about the fonts in your printer or the fonts that it picks up from GhostScript.
 
To change single text attributes such as 'Bold', 'Italic' and 'Underlined', you can also use the options in the 'Font' menu. Subscript and Superscript refer to the position of the 2 in x2 and H2O respectively. The strikethrough option is to draw a line over your text. The text color option can be used to insert text in different colors. The small caps toggle can be used to convert text to Small Capitals. The all caps toggle is to support the option of the rtf file format to render text in capitals and to make up an even number of toggles.
 
To check what fonts are available and how Ted maps the fonts to PostScript and to X11 fonts, select a font and watch the font names immediately below the example drawing on the font tool. The first name is the name of the X11 font that Ted uses to display the font on screen. The second name is the name of the PostScript font that Ted has matched to the font name in the document.
 
The following illustration shows the Font page of the Format Tool.
 
 
 
<IMG>
 
 
8) Pictures
You can include pictures in your texts. To do so select the Include Picture option in the Insert menu. A file chooser will allow you select a picture file to include in your text. The usual picture file formats such as tiff, bmp, xwd and jpeg are supported. It is also possible to paste pictures from other X11 applications. Unfortunately, only a limited number of X11 applications actually support Copy/Paste of pictures.
 
To resize a picture select it. Eight resize squares will appear. Dragging the squares with the mouse will resize the picture. Alternatively, you can use the Image page on the format tool to to scale the image to the desired size.
Control
Explanation
Pixel Size
If the image is a pixel based image the width and height of the image in pixels.
Size in Bytes
The size in bytes of the image data in the rtf document.
Image Wide
The width of the image in metric units. The width is a dimension. You can enter any valid dimension as described in the section on configurable resources. Use the Enter key to validate the dimension, to convert it to the default unit and to calculate the horizontal scale.
Image High
The height of the image in metric units. The height is a dimension. You can enter any valid dimension as described in the section on configurable resources. Use the Enter key to validate the dimension, to convert it to the default unit and to calculate the vertical scale.
Horizontal Scale
The scale of the image in the horizontal direction. Use the Enter key to validate the scale and to calculate the size in metric units.
Vertical Scale
The scale of the image in the vertical direction. Use the Enter key to validate the scale and to calculate the size in metric units.
Apply to Image
Adapt the embedded image to the values you just entered.
Revert
Show the properties of the image as they are stored in the document.
 
<IMG>
<IMG>
 
 
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 'Insert' 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.
 
 
<IMG>
 
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 ½. On PC keyboards the 'Compose' key is often labeled 'Scroll Lock' for your amusement. Refer to the paragraph on X11 configuration for some further remarks.
 
9) Copy/Paste
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 documents4. 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.5 Copy/Paste is also possible with picture oriented X11 applications that support the exchange of PIXMAP selections. With these applications, such as xmag and xpaint, scaling information is lost.
 
A special hack exists in the code to cooperate with the Copy/Paste mechanism that John Bradley's xv implements itself with X11 window properties on the root window. X11 selections that conform to the conventions of the X11 Inter-Client Communications Conventions Manual (ICCCM) always have priority over those from xv. This is a peculiarity of the way xv implements its clipboard, not a bug in Ted. Because of this peculiarity, you must set the X resource Ted.supportXvCopyPaste=1 to enable copy/paste with xv.
 
Both the Netscape Composer and the Gimp handle Copy/Paste of anything but plain text inside the program. This makes Copy/Paste with programs like Ted that do Copy/Paste in the normal X11 way impossible.
 
The copy/paste ruler mechanism works like a normal copy/paste: selection=RTFRULER, target=application/rtf. The contents of the window property that is exchanged is a complete rtf document with one (empty) paragraph. The relevant paragraph properties are picked up by the pasting document. The fact that the target (i.e. content-type) is application/rtf may seem a little surprising. The paste buffer is a valid rtf document however. Only the way in which Ted uses it is special. The ruler properties that are exchanged are the following: (1) Left Indent, (2) First line indent, (3) right indent, (4) Tabs. Or if the paragraph is a member of a list: (1) List and (2) list indentation level.
 
10) Finding and Replacing Text
With the 'Find Tool' you can look for certain fragments of text. You can activate the 'Find Tool' by selecting 'Find' in the 'Tools' menu, or by typing Control-F. The Find tool has two frames. In the first frame, you can enter the pattern to look for. In the second frame you can enter a replacement. The 'Find' button looks for the next occurrence of your pattern in the document. The 'Previous' button searches backward in the document. When your pattern is found, you can enter a replacement and push the 'Replace' button to replace the pattern with the replacement. The 'Replace, Next' button is a shortcut for clicking 'Replace' and then 'Next'.
 
<IMG>
 
Depending on the value of the check box below the pattern, that Ted tries to find in your text is not simply a piece of text, but a regular expression. Regular expressions are a means to look for several different pieces of text at once. Normally, you will not be interested in using regular expressions at all. The advanced user can select the check box to look for a match of a regular expression. Once a find command is given, use the 'Find Next' option in the 'Edit' menu (F3) to look for the next occurrence.
 
For simple text retrieval scripts, the search can be given on the Ted command line: If the pattern occurs in the document, the first occurrence of the pattern is selected after Ted has opened the document. Subsequent occurrences can be found with the F3 key. An example of a very simple text retrieval shell script that opens all rtf files that contain a certain pattern is:
 
#!/bin/sh
pattern="$1"
shift
 
files=`grep -l -e "$pattern" $*` && exec Ted --Find "$pattern" $files
echo No files containing "'$pattern'"
 
The two special Ted invocations are:
Ted --Find pattern files
Look for pattern in the files. The pattern is a string.
Ted --RegFind pattern files
Look for pattern in the files. The pattern is a regular expression.
 
The regular expression matching algorithm in Ted was borrowed from the regex library by Henry Spencer. For details refer to the acknowledgments. I quote from the original documentation by Henry Spencer: (Please realize that the casual user does not need to use or understand regular expressions.)
 
REGULAR EXPRESSION SYNTAX
A regular expression is zero or more branches, separated by `|'. It matches anything that matches one of the branches.
A branch is zero or more pieces, concatenated. It matches a match for the first, followed by a match for the second, etc.
A piece is an atom possibly followed by `*', `+', or `?'. An atom followed by `*' matches a sequence of 0 or more matches of the atom. An atom followed by `+' matches a sequence of 1 or more matches of the atom. An atom followed by `?' matches a match of the atom, or the null string.
An atom is a regular expression in parentheses (matching a match for the regular expression), a range (see below), `.' (matching any single character), `^' (matching the null string at the beginning of the input string), `$' (matching the null string at the end of the input string), a `\' followed by a single character (matching that character), or a single character with no other significance (matching that character).
A range is a sequence of characters enclosed in `[]'. It normally matches any single character from the sequence. If the sequence begins with `^', it matches any single character not from the rest of the sequence. If two characters in the sequence are separated by `-', this is shorthand for the full list of ASCII characters between them (e.g. `[0-9]' matches any decimal digit). To include a literal `]' in the sequence, make it the first character (following a possible `^'). To include a literal `-', make it the first or last character.
 
AMBIGUITY
If a regular expression could match two different parts of the input string, it will match the one which begins earliest. If both begin in the same place but match different lengths, or match the same length in different ways, life gets messier, as follows.
In general, the possibilities in a list of branches are considered in left-to-right order, the possibilities for `*', `+', and `?' are considered longest-first, nested constructs are considered from the outermost in, and concatenated constructs are considered leftmost-first. The match that will be chosen is the one that uses the earliest possibility in the first choice that has to be made. If there is more than one choice, the next will be made in the same manner (earliest possibility) subject to the decision on the first choice. And so forth.
For example, `(ab|a)b*c' could match `abc' in one of two ways. The first choice is between `ab' and `a'; since `ab' is earlier, and does lead to a successful overall match, it is chosen. Since the `b' is already spoken for, the `b*' must match its last possibility--the empty string--since it must respect the earlier choice.
In the particular case where no `|'s are present and there is only one `*', `+', or `?', the net effect is that the longest possible match will be chosen. So `ab*', presented with `xabbbby', will match `abbbb'. Note that if `ab*' is tried against `xabyabbbz', it will match `ab' just after `x', due to the begins-earliest rule. (In effect, the decision on where to start the match is the first choice to be made, hence subsequent choices must respect it even if this leads them to less-preferred alternatives.)
 
11) Spell checking
Use the spelling tool to check the spelling of your document. With the menu in the dictionary frame, you can select the language that you want to use for spell checking. All Language.ind files in /usr/local/ind 6 are listed in the dictionary menu.
 
The 'Learn' and 'Forget' buttons in the dictionary frame allow you to customize your dictionary. The word in the text field below the list of guesses can be included in the dictionary with the 'Learn' button, or removed from the dictionary with the 'Forget' button. For a description of the file that is used to store your modifications to dictionaries see below.
 
The 'Find Next' button looks for the next unknown word in the text. If one is found, Ted tries to find similar words in the dictionary and shows them in the list with guesses. Clicking on a word in the list of guesses stores the word in the text field under the list. A double click uses the selected word to correct the word in the text.
 
The 'Ignore' button ignores the unknown word. The word is not reported as misspelled for this language any more until Ted is stopped. Ted looks for the next unknown word. The 'Find Next' button looks for the next unknown word. The 'Correct' button uses the word in the box below the list to correct the word in the text. The 'Guess' button looks in the dictionary for words similar to the word in the box below the list.
 
Below is an image of the spelling tool
<IMG>
 
 
System dictionaries are stored in an optimized read only binary format. For those with some technical curiosity: It is the memory image of a minimal finite automaton that recognizes all the words in the dictionary. The data structure is very similar to Donald Knuth's tries. Personal deviations from the read only system dictionaries are stored in <Language>.changes files in a users $HOME/.Dictionaries directory. Every time the user pushes the 'Learn' or 'Forget' button, a line is added to the changes file. The first character of the line is an 'F' or an 'L', the second character is a space, the rest of the line is the word or phrase that is added or removed. As the file is never reorganized, the order of the lines in the file is important. E.G. If a word is first added and then removed again.
 
12) Hyperlinks and bookmarks
To change a text region into a hyperlink, select the text, choose the 'Hyperlink..' option from the 'Insert' menu and enter the destination of the link in the 'Hyperlink..' dialog. The 'Hyperlink..' dialog can also be used to change, remove or follow links. Below is an image of the 'Hyperlink' dialog.
 
<IMG>
 
Enter the name of the document or web page you want to link to in the 'Document' box. If you leave the 'Document' box empty, the link is to a bookmark in the document itself.
Enter the name of a bookmark in the 'Bookmark' box. If you leave the 'Bookmark' box empty, the link is to the document as a whole. If no document is given in the 'Document' box, the link is to a bookmark in the document itself. You can select a bookmark from the list of bookmarks below the 'Bookmark' box.
Normally, the text you have selected is converted to a hyperlink. For new links to the document itself, three special kinds of link are available:
·
Link as Page Number: The link is shown as the page number of the beginning of the bookmark. This is particularly useful in phrases like "Refer to the explanation on page 36". Ted will automatically update the page number when the bookmark moves or the layout of the document changes. Note that page number references in the text are not automatically updated while you type. That would make Ted too slow. They are however updated before you print and the next time that you open the document. MS-Word does not recalculate page numbers when you open a document. To make MS-Word recalculate the page numbers, wait until the document is completely formatted, then use control-A to select the text of the whole document and F9 to recalculate all fields. 
·
Link as Bookmark Text: The link is shown as the text of the bookmark. This is particularly useful in phrases like "This is explained in the Average Yearly Temperature section." The advantage is that when the text of the bookmark changes, the text of the link is changed as well. 
·
Link as Bookmark Text and Page Number: The link is shown as the text of the bookmark, followed by a tab and the page number of the beginning of the bookmark. This is particularly useful when you want to build a table of contents. Note that page number references in the text are not automatically updated while you type. That would make Ted too slow. They are however updated before you print and the next time that you open the document. 
The 'Set Link' button changes the destination of an existing hyperlink or makes a new link of the desired kind.
The 'Follow Link' button follows the link. If it is to a location inside the document itself, Ted will select this location. If it is to a document on the same computer, Ted tries to open it. If it is an internet link, Ted invokes Netscape to follow the link.
The 'Remove Link' button changes a hyperlink back to plain text.
The 'Cancel' button removes the hyperlink dialog from screen without doing anything.
 
Bookmarks are a way to give locations in your document a name. Once a location has a name, you can jump to it with a hyperlink or you can refer to it in the document indirectly. For example you can refer to the text inside a bookmark or to the number of the printed page that the bookmark appears on. To insert and inspect bookmarks, choose the 'Bookmark..' option from the 'Insert' menu. The 'Bookmark' dialog appears.
 
<IMG>
 
To add a bookmark, enter the name of the bookmark in the 'Bookmark..' dialog. Ted suggests a name for the bookmark based on the contents of the selected area in the document. To make a new bookmark or to change the name of an existing bookmark push the 'Set Bookmark' button. Push the 'Remove Bookmark' button to remove an existing bookmark. To jump to a bookmark type its name in the 'Bookmark' box and push the 'Go To Bookmark' button. In stead of typing the name of a bookmark, you can select it in the list of bookmarks below the text box.
 
Use the 'Copy Bookmark' frame to copy a reference to a bookmark to the clipboard. Push the 'Copy' button to copy the bookmark to the clipboard. Pasting the clipboard to a different location in the document or to a different document will insert a hyperlink that refers to the bookmark. A bookmark can be copied in four different formats that determine what kind of hyperlink will be inserted when the copied bookmark is pasted.
·
As a hyperlink with constant text. 
·
As a reference to the bookmark that is shown as its page number. 
·
As a reference to the bookmark that copies the current text of the bookmark every time it is printed. 
·
As a copied reference to the bookmark that copies the text and one that shows the page number, separated by a tab. This can be used to make a simple table of contents. 
The last three kinds of hyperlinks only make sense when they are contained in the same document as the bookmark that they refer to.
 
Hyperlinks and bookmarks are particularly interesting when the text is saved to HTML or Acrobat PDF format and as a simple way to make a table of contents.
 
With the introduction of text colors between Ted 2.11 and Ted 2.12, hyperlinks are no longer automatically drawn in blue because they are a hyperlink. New hyperlinks are blue, but hyperlinks from older versions are no longer blue, nor are they underlined. To change the hyperlinks as saved by older versions of Ted to blue and underlined once run the command "TED_HYPERLINKS_BLUE=1 Ted old.rtf" and save the document. As the effect of the environment variable is a little drastic, do not set it by default but only use it for conversions.
 
13) Paragraphs and the ruler
A paragraph is a piece of text that is folded between the margins of the page. Usually a paragraph just begins on a new line. With the Start on New Page switch on the format tool, paragraphs can be made to start on a new page. Usually the division of a document in pieces that start on a new page is achieved by dividing the document in sections, not by explicitly making paragraphs begin on a new page as a property of the paragraph.
 
Every paragraph in a text has a ruler. The ruler determines how the text of the paragraph is folded between the margins of the page, or those of the table cell that contains the paragraph. The ruler is shown at the top of the text window. It defines some properties of a paragraph. For paragraphs in a list, the ruler of the list level applies. It can only be manipulated on the Bullets and Numbering page of the format tool.
<IMG>
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. 
<IMG>
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. 
<IMG>
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. 
<IMG>
A series of tab stops. Tab stops are shown as little brackets in the white band of the ruler. If there is no tab stop to the right of a certain position, Ted uses left aligned tab stops at multiples of a half inch from the left margin. In many cases tables are a better way to format text in columns than tab stops. 
 
The position of the different indentations and the tabs can be changed by dragging their controls on the ruler. Tab stops can be set by clicking on the white band of the ruler. Tab stops can be removed by dragging them from the white band. The little button in the upper left corner of the ruler determines what kind of tab stops are inserted when you click in the white band of the ruler:
<IMG>
Inserts a left tab stop: The text after the tab stop is left aligned to the tab stop. 
<IMG>
Inserts a right tab stop: The text after the tab stop is right aligned to the tab stop. Effectively the text appears before the tab stop. 
<IMG>
Inserts a centered tab stop: The text after the tab stop is centered around the tab stop. After formatting the tab stop is exactly in the middle of the text. 
<IMG>
Inserts a decimal tab stop. The text after the tab stop is centered around the tab stop. After formatting the tab stop is at the position of the decimal point in the text (If there is one). 
In many cases tables are more convenient to align text in columns. Use paragraph alignment inside the cells of the table to align the text in columns in stead of tab stops.
 
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. Use the menu option to remember the ruler of the paragraph where the selection begins. 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 properties of a paragraph are considered to define the ruler: left indent, first line indent, right indent, tabs, justification, list membership, list indentation level. If you copy the ruler of a paragraph in a list, the paste operation will include all selected paragraphs in the list.
 
Use the 'Make One Paragraph' option to merge the paragraphs in the selection into one paragraph. This is particularly useful in documents that originate from a file that has been made with a plain text editor like vi or emacs.
 
The Decrease Indent and Increase Indent menu options in the format menu change the indentation level of the paragraph. For paragraphs in a list, the options change the list indentation level. For other paragraphs, the options change the Left Indent property.
 
Ted supports some additional paragraph formatting properties. The controls on the 'Paragraph Formatting' page of the Format tool allow you to change the properties of a paragraph. Note that although all sizes are displayed in points, that you can enter sizes in different units. When you push the 'Enter' key, the size is translated to points.
 
The following illustration shows a paragraph and its ruler.
 
<IMG>
 
Use the Paragraph Formatting page on the Format Tool to change formatting properties of the current paragraph manually. Use the Tabs page on the Format Tool to manage tab settings in more detail than with the ruler.
 
<IMG>
<IMG>
 
Paragraph properties on the Paragraph Formatting page of the Format Tool:
 
Property
Explanation
First Line Indent
Is the distance of the first letter on the first line of the paragraph from the page (or table cell) left margin.
Left Indent
Is the distance of the first letter of the second and subsequent lines in the paragraph from the page (or table cell) left margin.
Right Indent
Is the distance of the last letter of the lines in the paragraph from the page (or table cell) right margin.
Alignment
Determines how the contents of the lines of the paragraph are aligned relative to the page or to the table cell that contains the paragraph.
Spacing
Normally, the distance between the lines in a paragraph is determined by the biggest font or in-line image in the paragraph. The 'Spacing' menu allows you to influence the distance between the lines. The possibility to apply the line spacing to the last line of the paragraph is not yet supported in the Ted 2.17 format tool.
Space Above
Allows you to give the height of the white strip of paper above the first line of the paragraph.
Space Below
Allows you to give the height of the white strip of paper below the last line of the paragraph.
Start on New Page
Check this box to make Ted skip to a new page when it formats this paragraph. This property does not apply to paragraphs inside tables.
Keep on One Page
Do not divide this paragraph between pages, except when it contains explicit page breaks. If the paragraph is longer than a page, this property is ignored.
Widow/Orphan control
If this paragraph divided over pages, it is done in such a way that the first and the second line of the paragraph are on the same page. The same applies for the last two lines of the paragraph.
Keep with Next
The text is divided over pages in such a way that this paragraph appears on the same page as the next one. Typically because it is the heading of the next paragraph.
 
Document properties and tab settings on the Tabs page of the Format Tool.
 
Property
Explanation
Default Tab Stops
If the ruler contains no tab stops, or right of the rightmost tab stop, Ted uses default left aligned tab stops at a regular interval. With the Default Tab Stops frame you can set this interval for the whole document.
Tab Stop
With the controls in the Tab Stop frame and the list of tab stops above it, you can manage the tabs on the ruler of the current paragraph in detail. Select a tab stop in the list to change its properties, or enter a new position to add a new tab stop.
Position
The position from the left margin of the document for the tab stop. The default unit for the position is the typographic point. It is however possible to enter values like '13mm' or '1/2"'. Ted will convert them to points for you.
Alignment
The alignment of the text to the tab stop. The following values are supported:
Left
The text following the tab stop, upto the end of the paragraph, or upto the next tab stop will be placed at the right of the tab stop position. So the left of texts placed after the tab stop on different text lines aligns. 
Right
The text following the tab stop, upto the end of the paragraph, or upto the next tab stop will be placed at the left of the tab stop position. So the right of texts placed after the tab stop on different text lines aligns. 
Center
The center of the text following the tab stop, upto the end of the paragraph, or upto the next tab stop will be placed at the the tab stop position. So the centers of texts placed after the tab stop on different text lines align. 
Decimal
The decimal point of the text following the tab stop, upto the end of the paragraph, or upto the next tab stop will be placed at the the tab stop position. So the decimal points of texts placed after the tab stop on different text lines align. 
Leader
To place text at a tab position, Ted inserts white space between the text before the tab stop and the text after it. In some cases it is desirable to insert something different. E.G. in a table of contents. Ted supports the following possibilities:
None
Insert white space. 
Dots
Draw dots between the text before the tab stop and that after it. 
Line
Draw a solid line between the text before the tab stop and that after it. 
Dashes
Draw dashes between the text before the tab stop and that after it. 
 
14) Paragraph borders and shading
Use the Paragraph borders and shading page of the format tool to set paragraph borders and to change the background for the text of the paragraph. Ted 2.17 only allows you to give paragraphs a top border and a bottom borders. It only supports solid backgrounds and solid borders. Below is an image of the Paragraph Borders and Shading tool.
 
<IMG>
 
 
Property
Explanation
Top Border
When on, the paragraph has a top border. You can enter the width of the border in the text box right of the toggle button. The maximum is 3.75 points. (About 1.25 mm) Though the RTF file format supports many different styles for borders, Ted only supports solid borders.
Bottom Border
When on, the paragraph has a bottom border. You can enter the width of the border in the text box right of the toggle button. The maximum is 3.75 points. (About 1.25 mm) Though the RTF file format supports many different styles for borders, Ted only supports solid borders.
Color
Makes it possible to select a color for the borders. Refer to the explanation of the color choosers for details.
Background
You can give the paragraph a solid background color. Though the rtf file format supports many shading styles, Ted 2.17 only supports solid backgrounds.
 
15) Tables
To insert a table into a document, select 'Insert Table' in the 'Table' menu. By default, tables are just a formatting means. The borders of the table cells are not visible. Ted visualizes the structure of tables with light gray borders for the cells. If you find this annoying, use the 'Draw Table Grid' menu option in the 'Table' to hide them. To add borders to the rows and columns of a table, use the Row, Column and Cell pages of the format tool.
 
If the selection is inside a table, the document window gets a special ruler. It allows you to move the borders of a table by dragging them to the left and to the right. The illustration below shows the process. Selections inside tables remain inside the contents of one cell or select a rectangular range of complete cells. So when one end of the selection leaves the current cell, the whole cell is selected.
 
 
<IMG>
 
The table related pages of the format tool permit you to do more complicated things to the formatting of tables, such as giving the cells in the table borders and changing the internal margins of the cells. It also allows you to delete rows or columns, to insert rows or columns before the selection, as opposed to the menu options, that only allow you to add them after the selection. Below we first describe the Table page and the Row page, then the Column page and Cell page of the format tool. Note that although all sizes are displayed in points, you can enter sizes in different units. When you push the 'Enter' key, the size is translated to points.
 
 
<IMG>
<IMG>
 
 
Property
Explanation
Left Margin
Is the distance of the left margin of the table from the left margin of the page. Negative values mean that the left border of the table is left of the left margin of the page. If the value is the negative of that of Cell Margin, the left margins of the text inside and outside the table align. This property is separately stored for every row in the table. Usually it is not a good idea to change the value for individual rows.
Cell Margin
Is the distance of the text to the left or right margin of the cells in the table. This property is separately stored for every row in the table. Usually it is not a good idea to change the value for individual rows.
Top Border
When on, the row gets a top border. You can enter the width of the border in the text box right of the toggle button. The maximum is 3.75 points. (About 1.25 mm.) Ted 2.17 only supports solid borders.
Bottom Border
When on, the row gets a bottom border. You can enter the width of the border in the text box right of the toggle button. The maximum is 3.75 points. (About 1.25 mm) Ted 2.17 only supports solid borders.
Color
Makes it possible to select a color for the borders. Refer to the explanation of the color choosers for details.
Keep on One Page
When the Keep on One Page toggle is on, the row is not divided over pages. If it does not fit as a whole on a page, it is moved to the next page in order not to be divided over more than one page.
Is Table Header
Tables in the body if a document can span more than one page. Make the first row of the table a table header to tell Ted to repeat the first row at the top of every page where the table is continued.
Height Free
The height of the row is that of its highest cell.
Height at Least
The height of the row is at least the number in the text widget. If a cell in the row is higher, the height of the row is adapted to the cell.
Height Exactly
The height of the row is the number in the text widget, even if the contents of the cells do not fit.
 
<IMG>
<IMG>
 
 
Property
Explanation
(Column) Width
The width of the selected column. The table tool tries to prevent you from changing a column width to a value that makes the table wider than the page.
Rows Occupied
The number of rows that is spanned by this cell. A number bigger than 1 tells Ted to claim space in subsequent rows of the table for the contents of this cell. This property sets the rtf equivalent of the HTML rowspan property.
Cells Occupied
The number of columns that is spanned by this cell. A number bigger than 1 tells Ted to claim space in subsequent columns of the table for the contents of this cell. This property sets the rtf equivalent of the HTML colspan property.
Left Border
When on, the column/cell gets a left border. You can enter the width of the border in the text box right of the toggle button. The maximum is 3.75 points. (About 1.25 mm)
Right Border
When on, the column/cell gets a right border. You can enter the width of the border in the text box right of the toggle button. The maximum is 3.75 points. (About 1.25 mm)
Top Border
When on, the cell gets a top border. You can enter the width of the border in the text box right of the toggle button. The maximum is 3.75 points. (About 1.25 mm.) Ted 2.17 only supports solid borders.
Bottom Border
When on, the cell gets a bottom border. You can enter the width of the border in the text box right of the toggle button. The maximum is 3.75 points. (About 1.25 mm) Ted 2.17 only supports solid borders.
Color
Makes it possible to select a color for the borders. Refer to the explanation of the color choosers for details.
Background
You can give the cell a solid background color. Though the rtf file format supports many shading styles, Ted 2.17 only supports solid backgrounds.
 
Though the RTF file format supports many more kinds of borders, Ted only uses and manipulates the borders of the individual cells. In the RTF format borders can have many different styles. Ted only supports solid borders. The controls on the Row and Column pages of the Format Tool change the border for all cells in the row or column.
 
16) Sections
 
Longer documents can be divided in sections. Sections can be compared to the chapters of a book. By default Ted starts sections on a new page. Different sections can have different ways to number the pages and different page headers and footers. Different sections can even use a different page layout. Use the 'Headers and Footers' page of the format tool to change the headers and footers of the section. Use the 'Page Layout' page of the format tool to change the page layout for a section.
<IMG>
Section properties on the Section page of the Format Tool:
Property
Explanation
Begins
Tells Ted where to start this section. By default new sections start on a new page. Possibilities are:
·
Below Previous: The transition from the previous section to this one does not cause Ted to start a new page. 
·
In Next Column: If the section has multiple newspaper style columns, the formatter starts a new column for this section. As Ted 2.17 does not implement multi column sections, it begins the section on the next page. 
·
On New Page: Ted starts the section on a new page. 
·
On Even Page: Ted starts the section on an even numbered page. If the next page has an odd number, a blank page is inserted. 
·
On Odd Page: Ted starts the section on an odd numbered page. If the next page has an even number, a blank page is inserted. 
Page Number Style
The kind of page numbers that are used in the headers and/or footers on pages belonging to this section. Numbers with the same style are used in references to pages in this section.
Start with Page
Normally the pages of a document number from one at the beginning of the document. With the 'Start with Page' toggle you can give the section its own page numbers. With the text box on the right you can even give the number that is used for the first page of the section.
Columns
The number of newspaper style columns that is used to format this section. Newspaper style columns are not implemented in Ted 2.17.
Column Spacing
The spacing between the newspaper style columns that are used to format this section. Newspaper style columns are not implemented in Ted 2.17.
Column Width
The width of the newspaper style columns that are used to format this section. Newspaper style columns are not implemented in Ted 2.17.
 
17) Footnotes and Endnotes
To insert a footnote or endnote use the Insert Footnote option in the Insert menu. Normally footnotes are placed at the bottom of the page, and each note has a different number. To get different kinds of notes, or to change the way notes are handled in the document use the Notes page of the Format Tool.
 
<IMG>
The Notes tool has three frames. The top frame manages the properties of the current footnote or endnote.
 
Property
Explanation
Footnote
Make the current note a footnote.
Endnote
Make the current note an endnote.
Fixed Text
Check the box and enter a fixed text to give the note a text that is independent of its position on the document. Uncheck to give the note an automatic number. You can use this option to reinsert a note number that you have deleted by accident.
Find Note
From inside the note, jump to the reference in the text.
Edit Note
From the reference to the note, jump to the text of the note.
Revert
Display the properties of the note again.
Apply to Note
Change the properties of the note. E.G. convert a footnote to an endnote or the other way round.
 
The Footnotes and Endnotes frames manage the properties of all footnotes or endnotes in the document.
 
Property
Explanation
Position
The position of the notes in the document.
Page Bottom Place footnotes at the bottom of the page.
Below Text Place footnotes immediately below the text on the page that refers to them.
End of Section Place endnotes at the end of the section that refers to them.
End of Document Place endnotes at the end of the document.
Numbering
Continuous
All footnotes or endnotes respectively have a unique number in the document. 
Per section All footnotes or endnotes respectively have a unique number in the section that refers to them. The numbers restart for every section.
Per Page The numbers of the footnotes restart on every page.
Number Format
Select a format for the number of the footnotes or endnotes.
First Number
With continuous numbering this is the number of the first footnote or endnote.
Revert
Display the settings in the document relating to notes again.
Apply to Document
Change the settings in the document relating to notes.
 
Between the text and the notes Ted inserts a separator. In a sense it is a special kind of note. Potentially a document can have four different separators: Between text and footnotes, Between text and endnotes, Between text and continued footnotes and between text and continued endnotes. Ted 2.17 does not support continued notes. By default the separator just consists of a two inch long horizontal line. The option in the insert menu to insert this kind of line in the text is only enabled when you are editing one of the note separators.
 
18) Page Headers, Page Footers and Page Numbers
Every section of the document has its own headers and footers. The headers and footers are printed in the top and bottom margins of the page. The exact location is controlled by the 'Page Layout' page of the format tool. To make a header or footer, use the 'Edit Header' or 'Edit Footer' buttons on the 'Headers and Footers' page of the format tool.
 
<IMG>
What headers and footers are used for a section is depends on two things: Whether the section uses different headers and footers for its first page or not, and whether the document uses different headers and footers for odd and even pages. Use the toggles to change these properties.
Select the kind of pages you want to influence in the menu and push the 'Edit Header/Footer' or 'Delete Header/Footer' buttons to delete or edit a header or a footer. If the section does not have a header or footer for a certain kind of pages, it is made when you push the 'Edit Header/Footer' button. To use all relevant kinds of headers and footers, a section needs to have at least three pages. (First,Even,Odd.) As you edit headers and footers in place, it is not possible to edit the headers and footers for the pages that the section does not use. This means that you might have to temporarily insert a page break in the text to make a particular header or footer accessible. On the other hand the document does not use the header or footer anyway.
 
To insert a page number in a header or a footer, use the 'Insert Page Number' menu option. You can only insert page numbers in headers or footers.
 
19) Page Size and Page Margins
 
The page size and the margins of a fresh document are determined by some resources as discussed in the configurable resources paragraph. The page size, the page orientation and the margins of a document can be changed with the 'Page Layout' page of the format tool. For the format of the values that can be entered in the text widgets, please refer to the syntax of the resources. Pressing the 'Enter' key in the text widgets refreshes the drawing on the Page Layout tool to give you an impression of what you have selected. The RTF file format stores page layout information in two places. For the document as a whole and for the individual sections in the document. Although a different page layout for different sections in a document might not be particularly useful, Ted allows you to only change the page layout of the selected sections in the document. Ted 2.17 only partially supports different page layouts for different sections. Switching between portrait and landscape is only supported when printing. On screen the sections with a layout that is different from that of the document as a whole are not always rendered correctly. The illustration below shows the page layout page of the format tool.
 
 
 
<IMG>
Control
Explanation
Page
Choose or type the page size. The page size value is a dimension. Refer to the section on configurable resources for details.
Portrait/Landscape
In Portrait, the horizontal sides of the page are the short ones. In Landscape, the vertical sides are shorter than the horizontal ones.
Margins
Give the width of the margins. The width of a margin is a dimension. Refer to the section on configurable resources for details.
Header
The position of the top of the header on the page. NOTE that the header will be placed in the top margin of the page. In the undesirable situation where the text of the header does not fit between the header position and the top margin of the page, Ted will silently use a wider top margin.
Footer
The position of the bottom of the footer on the page. NOTE that the footer will be placed in the bottom margin of the page. In the undesirable situation where the text of the footer does not fit between the bottom margin of the page and the footer position, Ted will silently use a wider bottom margin.
Apply to Selection
Change the page layout for the selected sections rather than for the whole document. Many documents only have one section, and in practice, even those with multiple sections use the same page layout for all sections.
Revert to Selection
Show the page layout settings for the first section in the selection.
Apply to Document
Change the page layout for the whole document.
Revert to Document
Show the page layout settings for the document as a whole.
 
 
20) Bullets and Numbering
Ted can automatically number paragraphs: A number is inserted at the beginning of the paragraph. The value of the number is managed by Ted. Numbered paragraphs are organized in lists. The number of the paragraph is the sequence number in the list. The two main purposes of paragraph numbers are numbered lists and the numbering of the paragraph headers that go into the table of contents of the document. You can manage paragraph numbers and the associated lists with the page on the format tool. To include a paragraph in the same list as some other paragraph copy the ruler of the source paragraph with the Copy Ruler menu option and paste the ruler into the target paragraph with the Paste Ruler menu option. Though paragraphs that are a member of a list do not necessarily have a visible paragraph number, all paragraphs that have an automatic paragraph number are a member of a list. The list indentation level of paragraphs in a list can also be controlled with the Increase Indent and Decrease Indent menu options in the format menu.
<IMG>
Example of Paragraph Numbers
The example list below mentions some controls on the Bullets and Numbering tool. The controls are organized in a list that has the same hierarchy as the controls have on the tool. The image of the tool was recorded when the word Format in red was selected.
Bullets and Numbering tool
1 List of List Levels
2 Operations on the Selection
2.1 Set List
2.2 Remove from List
2.3 Set Level
2.4 New List
3 Properties of the current List Level
3.1 Style
3.1.1 1, 2, 3
3.1.2 I, II, III
3.1.3 etc.
3.2 Format
3.3 First Line Indent
3.4 Left Indent
3.5 First Number
3.6 Justify
3.6.1 Left
3.6.2 Centered
3.6.3 Right
3.7 Separator
4 Revert
5 Change List
The Bullets and Numbering tool page has three areas: (1) A list to select a level in the current list. (2) A group of buttons to manage the paragraph number of the current selection in the document and (3) A group of controls to edit the properties of the list level that you have selected.
Control
Explanation
Set List
Make all paragraph is the selection a member of the same list as the first paragraph in the selection that is a member of a list.
Remove from List
Any paragraphs in the selection that are a member of a list are removed from the list.
Set Level
Any paragraphs in the selection that are a member of a list get the indentation level selected above.
New List
Start a fresh list in the document and make all paragraphs in the selection a member of the new list. The fresh list
Level n
The Level frame manages the properties of an indentation level in the list of the first paragraph in the selection. The higher the level number, the deeper the indentation.
Style
Choose a number style for the current level. The number style is used to format the sequence number of the paragraph in the paragraph number. Note that in multi level lists, the formatted sequence number also appears in the paragraph number of subsequent paragraphs with a deeper indentation level. Notice a changed style is immediately visible in the list of indentation levels.
Format
The actual format of the paragraph number. Apart from the sequence number of the paragraph in its own indentation level of the list, the format can refer to the sequence number of paragraphs with a shallower indentation. It can also contain constant text. The format editor is a subject by itself. It is explained below. Notice a changed format is immediately visible in the list of indentation levels.
First Line Indent
The ruler of paragraphs that are part of a list is controlled by the list level. Set the first line indent for paragraphs in the list level here. More explanation is available with the Paragraph Formatting page.
Left Indent
The ruler of paragraphs that are part of a list is controlled by the list level. Set the left indent for paragraphs in the list level here. More explanation is available with the Paragraph Formatting page.
First Number
List level numbering does not necessarily start with number 1. Give a different number if you want to.
Justify
Give that way in which the paragraph number text is justified to the first line indentation of the paragraph. The left indentation behaves like a tab stop. If the number is right aligned, its right hand side is aligned at the first line indent position of the paragraph.
Separator
Though usually the paragraph number is separated from the paragraph text by a tab, you can decide to use a space or no separator at all.
Revert
Forget all changes to all levels of the list that have been made on the tool.
Change List
Apply all changes to all levels of the list to the list in the document.
The format of the numbers of the paragraphs in a list level consists of pieces of constant text and of sequence numbers of the paragraph itself and of its parents in the hierarchy of the list. You can edit the pieces of constant text and change the sequence numbers one by one. To select a component of the number format use the arrow keys or the mouse. To edit the selected component, use the enter key or click on the selected component. Below I give an example of how the format can be edited. It covers most possibilities of the tool.
<IMG>
Select the (empty) text at the beginning of the format. Click on the black rectangle to edit the text before the 3.
<IMG>
Type an opening parenthesis; push the enter key to insert the parenthesis in the number format.
<IMG>
You have inserted the opening parenthesis before the 3. Use the right arrow key to select the (empty) text at the end of the format.
<IMG>
Use the enter key to edit the empty position; Enter a closing parenthesis and insert it in the format by hitting the enter key again.
<IMG>
Finally select the dot and replace it with a dash.
<IMG>
You have now changed the format for the second indentation level of the list. Push the Change List button to apply your changes to the list.
(3-2) Format
(3-3) First Line ..
Notice that all level 2 paragraphs in the list adapt to the changes.
<IMG>
To remove the initial parenthesis. You select it and you push the Delete key.
<IMG>
Select a sequence number and then push the Delete key. It is deleted.
<IMG>
Oops that is not what you wanted. You decide to reinsert the sequence number. So you push the Insert key.
<IMG>
You get a sequence number back, but it is the wrong one: Ted always inserts the number of the current level. To change the sequence number push the Enter key.
<IMG>
Use the mouse or the 1 key to select a reference to the number in the first indentation level.
<IMG>
You get the correct sequence number again.
 
Some of the properties of the paragraph and some of the formatting of the paragraph number depend on the list level rather than on the paragraph or the text itself. You will notice that you cannot edit the number or bullet of the paragraph, nor change its font. The indentation and the tabs for the paragraph are defined by the list. Not by the paragraph itself. You can change the font and color of the paragraph numbers on the List Font page of the format tool.
 
21) Choosing colors
On various pages of the format tool, you can select colors. The color choosers on the page itself offer a limited subset of the palette of the document. Choosers for backgrounds give the possibility to choose for no background color at all. Choosers for foregrounds give the possibility to select an automatic foreground color. Automatic foreground colors depend on the background color. In Ted 2.17 the automatic foreground color is always rendered in black. If you want to use a color that is not shown on the color chooser use the 'More Colors' item. It displays the full color chooser page where you can select any RGB color.
 
Just enter the Red, Green and blue values in the text boxes or click on the color that you want in the RGB cube. The RGB cube contains all 216 colors of the so called web safe palette. Use the toggles in front of the color names to open the RGB cube and to choose a color inside. Click on the outside of the RGB cube to open it at a different slice. Click on the gray background to rotate the RGB cube.
 
<IMG>
 
<IMG>
<IMG>
 
22) Printing from Ted, writing PostScript and Acrobat PDF
To print from Ted, select the 'Print...' option in the 'File' menu. The print dialog appears. The print dialog contains a menu with the printers that are available on your computer. In addition to the printers, the menu contains an option to print to file. If you have configured a fax command in your application resources, the menu will also contain a fax option. The list of printers is determined by calling the operating system printer management command. The following commands are tried in the order given. The first command that returns any printers determines the list of available printers and the print command that is used. (lp or lpr.)
 
·
lpc status (Use lpr to print) 
·
/usr/sbin/lpc status (Use lpr to print) 
·
enq -As (An AIX command, use lp to print) 
·
lpstat -a (Use lp to print) 
 
Note that Ted only prints to PostScript. The printer must support all fonts that Ted uses in a particular document. Refer to the section on adding fonts for instructions on how to upload extra fonts to your postscript printer. Those that do not have a postscript printer can use the excellent postscript emulation package GhostScript. It is available from ftp.cs.wisc.edu in the directory ghost. Both Aladdin GhostScript and GNU GhostScript offer good postscript emulation on a wide variety of printers. Besides it can be used as an alternative to the Acrobat distiller to convert PostScript files to Acrobat PDF format. Example script that use Ted and GhostScript to convert rtf files to PostScript and to PDF are included in the Ted distribution. Refer to the GhostScript documentation for instructions on how to add fonts to GhostScript. To support as many different types of printers as possible, Ted does not use advanced PostScript features. To reduce the volume of the printout of images you can activate the use of PostScript compression filters and/or indexed color images. Refer to the usePostScriptFilters and usePostScriptIndexedImages resources in the section on configurable resources.
 
 
Like the Fax option in the printer selection menu, the text widget to enter a fax number is only enabled when a fax command has been configured. Only when the fax has been selected as a printer, you can enter a fax number in it. For all other printers it is off. The illustrations below show the print dialog with the different options. By default Ted prints one page per sheet of paper. It is possible to print two or four pages of the document per sheet of paper. For this purpose, the output is scaled to fit on the sheet. Normally, Ted prints all the pages in the document. With the menu on the bottom of the Print.. dialog, printing can be limited to a range of pages. The two switches in the Placement frame can be practical when you want to print on small sheets of paper or on postcards. The first one tells Ted to rotate the pages on the paper, such that it can enter the printer with the short side first. The second one can be used with printers that center small sheets in the paper tray. The arrows near the page diagram on the print dialog show the orientation of the print-out as the paper passes through the printer.
 
 
<IMG>
<IMG>
 
<IMG>
 
<IMG>
 
 
Ted uses the Ted.paper resource to decide what the size of the paper in the printers is. This resource is also used to determine the page size of a fresh document. The PostScript that is sent to the printer assumes this paper size to be loaded in the printer. If you temporarily have a different size of paper in your printer, you can select a different paper size. Note that the paper size selected on the print dialog does not influence the formatting of the printout but only the placement of the formatted text on the page. To format a document for a different paper size use the page layout tool. The paper size selected on the print dialog only influences the placement of the formatted text on the paper, not the formatting itself. This is visualized by the diagram on the dialog. The same applies for the paper size arguments to the command line invocations. You can print more than one document page on a sheet of paper.
 
Value
Explanation
1 Page/Sheet
Print one page of the document per sheet of paper. Rotate if necessary to make it it fit on the sheet. But do not scale.
1 Page/Sheet Scale to Fit
Print one page of the document per sheet of paper. Rotate and/or scale if necessary to make it it fit on the sheet.
2 Pages/Sheet Vertical
Print two pages of the document per sheet of paper. Place them in two rows of one column. Rotate and/or scale if necessary to make them it fit on their half of the sheet.
2 Pages/Sheet Horizontal
Print two pages of the document per sheet of paper. Place them in one row of two columns. Rotate and/or scale if necessary to make it them fit on their half of the sheet.
4 Pages/Sheet Horizontal
Print four pages of the document per sheet of paper. Place them in two rows of two columns. Page 2 is in the same row as page 1. Rotate and/or scale if necessary to make them it fit on a quarter of the sheet.
4 Pages/Sheet Vertical
Print four pages of the document per sheet of paper. Place them in two rows of two columns. Page 2 is in the same column as page 1. Rotate and/or scale if necessary to make them it fit on a quarter of the sheet.
 
To print from the command line use the call Ted --print something.rtf. Below is a list of all possible kinds of non interactive Ted print commands. Only those starting with -- are listed. For the corresponding ++ commands, the X11 environment is only used to resolve configurable resources for these calls but it is still used. The -- commands do not use the X11 environment and can be used with the default settings that are compiled into Ted and the values from Teds private configuration files or those that come from the --setProperty arguments. Some of the calls use paper formats as arguments. Refer to the documentation of the Ted.paper resource for a list of paper formats. Note that Ted uses the file /etc/papersize to find a default paper format. The default format can be overridden with any of the configuration mechanisms.
 
Ted --print some.rtf
Print some.rtf on the default printer. (Usually called lp.)
Ted --printToPrinter some.rtf myprinter
Print some.rtf on the printer called myprinter.
Ted --printPaper some.rtf a4
Print some.rtf on the default printer, assuming there is a4 paper in the printer.
Ted --printPaper some.rtf letter
Print some.rtf on the default printer, assuming there is letter format paper in the printer.
Ted --printPaper some.rtf 8.5x12inch
Print some.rtf on the default printer, assuming the paper in the printer is 8.5 inch wide and 12 inch high.
Ted --printPaper some.rtf 100x141mm
Print some.rtf on the default printer, assuming the paper in the printer is 100mm wide and 141mm high. (Size of a6 postcards)
Ted --printToPrinterPaper some.rtf myprinter letter
Print some.rtf on the printer called myprinter, assuming there is letter format paper in the myprinter printer.
Ted --printToFile this.rtf that.ps
Convert this.rtf to a PostScript file called that.ps. The PostScript is meant for a printer loaded with the paper format given by the Ted.paper resource. If you give a dash as the output file name, the PostScript output is sent to the standard output.
Ted --printToFilePaper this.rtf that.ps legal
Convert this.rtf to a PostScript file called that.ps. The PostScript is meant for a printer loaded with legal format paper. If you give a dash as the output file name, the PostScript output is sent to the standard output.
Ted --RtfToPs and Ted --RtfToPsPaper a4. Read an rtf document from standard input and write the PostScript printout to standard output. I have been told that the commands are useful to in special applications and to be used with the CUPS Common Unix Printing System to automatically invoke Ted to print rtf documents. The commands do not have a ++ variant.
 
Ted includes so called pdfmarks in the postscript it writes. This allows the Adobe Acrobat distiller, or GhostScript to make pdf files that contain the same hyperlinks and bookmarks as the original rtf file. The GhostScript command to convert a postscript file to pdf is the following:
gs -q -dNOPAUSE -sDEVICE=pdfwrite -sPAPERSIZE=a4 \
-sOutputFile=that.pdf this.ps -c quit
Note that both the Ted --printToFile command and ghostscript accept a dash for the file names to indicate standard input or standard output. This allows you to emit the PDF output from a single pipeline without any intermediate file.
 
Together with GhostScript, Ted can be used to make high quality PostScript and Acrobat pdf files from your rtf files, even in a scripted way. Refer to the rtf2ps.sh and rtf2pdf.sh scripts in /usr/local/Ted for a complete example. The rtf2pdf script calls the GhostScript to pdf converter without any configuration arguments. For a list of possible parameters and some explanation refer to the GhostScript documentation: /usr/share/ghostscript/version/doc/Ps2pdf. For some explanation of the parameters refer to Adobe technical note #5151: Acrobat Distiller Parameters. It is available in pdf format from the Adobe web site. Pay particular attention to the -dAutoFilterColorImages=false and -sColorImageFilter=FlateEncode arguments to ghostscript and the --setProperty usePostScriptIndexedImages 1 and the --setProperty usePostScriptFilters 1 arguments to Ted to produce compact high quality PDF files.
 
The skipEmptyPages, skipBlankPages and omitHeadersOnEmptyPages properties control the way Ted handles empty pages while printing a document. See the section on configurable parameters for details.
 
Probably you use a special command to print to a PostScript printer. You can print to a custom printer by setting two resources in the resource file. The resource Ted.customPrintCommand is the command to print to the custom printer. Ted.customPrinterName is the name of the custom printer. If both resources are set, Ted inserts an extra option in the printer selection menu to print through the given command. Because the custom printing command is something special, Ted makes it the default printer. The value of customPrinterName is a short string that is used in the menu to select the custom printer. The value of customPrintCommand is an arbitrary shell command to print to the custom printer. If customPrintCommand contains the pattern %f the pattern is replaced with the name of a temporary file to print. Otherwise the PostScript to print is piped into the custom print command. If you use %f in customPrintCommand , it is the responsibility of customPrintCommand to delete te temporary file. To configure a second custom printer use the Ted.customPrintCommand2 and Ted.customPrinterName2 resources. The second custom printer will not become the default printer.
 
E.g. the following resource settings in your .Xdefaults, .Xresources or .Ted.properties file use ghostview as a print previewer:
Ted.customPrintCommand: ( ghostview '%f'; rm '%f' ) &
Ted.customPrinterName: Preview
Similarly the following can be used with the X11 Print Panel application: To give xpp optimal freedom to rotate and scale your document choose the paper format of the rtf document on the Ted print dialog.
Ted.customPrintCommand: ( xpp '%f'; rm '%f' ) &
Ted.customPrinterName: Print Panel
 
The APP_FAX_TO environment variable is to use Ted with Martin Vermeers FaxView package. If a fax command for Ted is given and APP_FAX_TO is set, Ted will select the fax as its default printer and enter the value in the fax number text box.
 
23) Saving documents to HTML and to plain text
You can save your documents in HTML format. As Ted cannot read HTML, this should be done with the 'Save To' menu option. If a document that contains bitmap images is saved to the file something.html, the images are saved to graphics files in the directory something.img. Images with few colors are saved to gif files. Images with many colors are saved to JPEG files with a .jpg extension. The names of the image files in the something.img directory are absolutely arbitrary but Ted tries to use the same name for the same image every time the document is saved to HTML.
 
As RTF and HTML differ a lot, both in the approach to document structure and in the formatting possibilities, I had to find a compromise between generating HTML that is as elegant as possible, and HTML that looks as much like the original RTF document as possible. I know that I am using too many <FONT> tags, but I could not find an acceptable alternative. If you are reading this document in HTML form, you can decide for yourself whether the result is ugly or not.
 
 
Hyperlinks are translated to <A HREF= "something" >. Bookmarks to <A NAME= "something">. Both footnotes and endnotes are converted to endnotes at the end of the document. Ted converts the note numbers to hyperlinks and bookmarks referring to each other.
 
The command Ted ++saveTo this.rtf that.html converts an rtf format document to HTML as a command line call. The X11 environment is only used to resolve configurable resources for this call but it is still needed. This is a known deficiency of Ted. An alternative call starting with -- in stead of ++ exists. It does not use the X11 environment and can only be used with the default settings that are compiled into Ted.
 
The 'Save As' and 'Save To' menu options allow you to save your document to plain text. Ted has two ways to save documents to plain text. The first one folds the text in the paragraphs in such a way that it can easily be used with character terminal style plain text editors such as vi and emacs. The second one saves each paragraph as one line of plain text. This is not very practical with plain text editors or when the text is to be printed, on the other hand, the paragraph structure of the original document is retained. The conversion call Ted ++saveTo this.rtf that.txt converts to the folded plain text format. When you open the that.txt file in Ted again, use the Make one paragraph option to reassemble the lines of a paragraph again..
 
24) Sending mail from Ted
You can mail the text that you are typing directly from Ted. Choose Mail.. in the File menu to use the mail dialog.
 
<IMG>
 
Enter a subject and the various kinds of recipients in the text fields7. 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. If you retrieve your mail via an internet provider, enter the mail address that you have with the provider here. not the address that you have on your own computer.
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 and HTML supporting mail readers are 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.
 
Note that Ted was never intended as a mailer application. The mail option is there as a shortcut for the cumbersome process of saving a text and then importing it into a mailer application. Obvious things like an address book or the possibility to read mail are missing.
 
Ted can send mail in three formats:
·
text/plain: The message is the document without any formatting. Just the text remains. All images and structuring is removed from the document. 
·
application/rtf: The document is sent as an attachment in exactly the same format as it would have been saved to a file. 
·
text/html: The text of the document is sent in HTML format. Actually the contents are not just the HTML that would have been saved to disk. The HTML and the included images are combined into a multipart/related mime message conforming to rfc 2557. (HTML mail) 
 
25) How to use Ted as a mime handler or 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 Ted '%s'
 
The result is a line application/rtf;/Ted '%s' in your $HOME/.mailcap file. Mail readers use the mailcap file to determine what program can be used to display mail attachments of a certain type. You could as well have included this line in the mailcap file with a text editor like vi or emacs. The /etc/mailcap file has the same role as a private .mailcap file. The settings apply for all users of the computer. To make an association between the application/rtf mime-type and the rtf file extension enter a line application/rtf rtf in either $HOME/.mime.types or /etc/mime.types. Though I describe the settings as settings for Netscape, the mechanism is a generally accepted convention that works for many Linux/Unix programs such as the Mutt mail reader. The convention is documented in rtf 1524: A User Agent Configuration Mechanism For Multimedia Mail Format Information. Rfc 1524 does not mention the need for single quotes around the %s that will be replaced with the file name. As many MS-Windows mailers use spaces in file names, the quotes might be convenient to prevent that the file name be cut into separate words by the intermediate shell that invokes Ted.
<IMG>
 
 
 
26) Configuring Ted
In general, it is not necessary to configure or customize Ted. All texts and default settings of Ted are however configurable. Ted has its own configuration mechanism. Additionally the texts and settings can be configured through the usual X11 application resources mechanism.
 
Teds own settings can be configured in two settings files: /usr/local/Ted/Ted.properties and $HOME/.Ted.properties in the users home directory. The file format is similar to the X11 resource file format: Every line consists of a name value pair. The name has the format Ted.property: value. Contrary to the X11 format trailing white space on the line is ignored. Ted does not support the line continuation syntax of the X11 configuration files. Completely empty lines and lines beginning with an exclamation mark are ignored. Properties that do not begin with Ted. or Ted* are ignored. To be compatible with some other kinds of property files lines that start with a number sign are ignored. For similar compatibility reasons, an equal sign is accepted for the colon after the name of the property. Please do not use the compatibility features nor the Ted*property syntax: They only exist to make it possible to share files with other software. System wide properties are set in usr/local/Ted/Ted.properties. Private settings for a particular user are set in her $HOME/.Ted.properties file. Settings for a particular invocation are given with --setProperty name value arguments to Ted. Private settings have priority over system wide settings. Command line settings have priority over system wide settings and over private settings. You can use as many --setProperty arguments in a Ted invocation as you want. The arguments are handled before any of the other command line arguments. Unknown properties are silently ignored. This applies for the properties in the settings files and for those that are given on the command line. If Ted uses uses the X11 windowing system, the settings that come from the X11 configuration have priority over the settings that come from --setProperty arguments. If you want to overrule settings that come from X11 configuration use the -xrm Ted.property:value syntax that belongs to X11 configuration mechanism. Unless you have a very good reason do not use both configuration mechanisms for the same property. E.G: the command Ted --setProperty usePostScriptFilters 1 --setProperty usePostScriptIndexedImages 1 --printToFile x.rtf y.ps uses the special PostScript settings for this invocation only. The invocation does not use the X11 window system. Teds configuration mechanism is most suitable to describe the environment. Use it to set the default paper format and the places where Ted looks for fonts.
 
To configure the user interface Ted supports the standard X11 resource mechanism. As Ted does not use documented widget names, only the texts in the user interface can be configured.8 Refer to the file /usr/local/Ted/Ted.ad.sample for a commented example resource 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 or $HOME/.Xresources. For every property called someprop, insert a line of the form Ted.someprop: somevalue in the resource file. Note that the default values for file locations mentioned below relate to the Ted distribution packages. If Ted is part of a Linux distribution, the file system hierarchy standards apply, and system independent files should be installed in /usr/share/Ted in stead of /usr/local. An explanation of the standard X11 resource mechanism is beyond the scope of the user manual of a word processor. Refer to the comments in the sample resource file for some more explanation. The X11 documentation is the ultimate source of information. The standard X11 command line arguments to override a resource value for a single invocation work as well. E.G: the command Ted -xrm Ted.magnification:200% x.rtf uses the excessive magnification for this invocation only. For more information read the X manual page. To temporarily change X11 resource values use the xrdb -merge command. Type or pipe the configuration lines into the standard input of the command. The X11 configuration mechanism is most suitable to configure the user interface.
 
Most settings relate to the texts of the different controls on the windows. These are not covered in this introductory manual. If you want to change the texts, for example to make localized Ted installations, refer to the Ted.ad.sample file for an example and an explanation. As the sample file contains all the defaults that are compiled into Ted, only what you change is relevant. The example resource file is extensively documented.
 
The following properties influence Teds functionality:
defaultFont: Used as the font of new documents. The format of the string is: <Family>,<Weight>,<Slant>,<Size>,<Underline>. E.G. "Helvetica,,,10" or "Times,Bold,Slanted,14,Underlined". Do not put the value in the resource file in quotes.
magnification: Magnification for drawing documents on the screen. The default value is 120%. The alternative format 1.2 for 120% is also supported. It has the disadvantage that it depends on the decimal sign of the current locale. (E.G: 1,2 for 120% in Western Europe.) Very small and very big values are ignored.
unit:
The unit that is used by default. This resource influences the appearance of the ruler and the interpretation of numbers entered in the format tool. Possible values are: inch, ", cm, mm, points, pt, picas, pi. 
paper:
The format of the paper in the printer. The paper format is used as the default page size for new documents. If a smaller page size is used for a document, Ted uses the Ted.paper resource to print in the upper left corner of the paper. Possible values are: a4,a5,letter,legal,executive and strings in the form <Width> x <Height> or <Width> x <Height> <Unit> where <Width> and <Height> are numbers. Values for units are given above. If <Unit> is omitted, the value of the 'unit' resource is assumed. Plain text files do not store a paper size for the file inside the file. The Ted.paper resource is used for the page layout of every plain text file that Ted opens. Note that Ted uses the file /etc/papersize to find a default paper format. The default format can be overridden with any of the configuration mechanisms. 
defaultPrinter: If you want to use a different printer than the system default printer as the default printer from Ted, you can set this resource to select that printer the first time you use the Print Dialog. The value is the name of a printer. Use the same names that you use in the lp -d somePrinter, or the lpr -P somePrinter commands.
leftMargin: The width of the left margin of a new document. The value must be a valid dimension. The format of a dimension is <Number> or <Number> <Unit>. Values for units are given above. If <Unit> is omitted, the value of the 'unit' resource is assumed.
rightMargin: The width of the right margin of a new document. The value must be a valid dimension.
topMargin:
The height of the top margin of a new document. The value must be a valid dimension. 
bottomMargin: The height of the bottom margin of a new document. The value must be a valid dimension.
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.
mailFrom:
The default sender of the mail messages. No default value exists. If none is given, the mailing software attempts to compose a name like 'Your Name <login@host.domain>'. If you retrieve your mail via an internet provider, give the mail address that you have with the provider here. not the address that you have on your own computer. 
mailHost:
The SMTP relay that is used to transmit your mail. The default is 'localhost'. 
mailPort:
The TCP/IP port number that is used to reach the mail server. The value of mailPort defaults to "smtp" which in its turn maps to the default value 25. Only in very rare cases it is desirable to override these defaults. The resource was added to make it possible to work around bugs in certain versions of the resolver libraries. 
afmDirectory The directory where Ted looks for font metric files. Only fonts that have a metric file in this directory can be used by Ted. In a default installation, metric files are expected in /usr/local/afm. This resource is particularly useful when you cannot install Ted as root, and hence you have to store the metric files in some private directory. You can also make the afmDirectory point to the GhostScript fonts directory. E.G. to /usr/share/ghostscript/fonts. Refer to the section on adding fonts for more details. Use the gs -h command to find the exact location of the GhostScript afm files.
spellToolSystemDicts: The directory where Ted looks for spelling dictionaries. In a default installation, spelling dictionaries are expected in /usr/local/ind. This resource is particularly useful when you cannot install Ted as root, and hence you have to store the dictionaries in some private directory.
documentFileName: The name of this online document file. In a default installation this is /usr/local/Ted/TedDocument-en_US.rtf.
faxCommand: The command that Ted uses to send the current document as a fax. In the command %f is replaced by a temporary file name, %n by the fax number and %t by the title of the document window. The fax command is assumed to accept PostScript as input. If the command contains occurrences of %f, a temporary file is written with PostScript, otherwise PostScript is piped into the command. To avoid strange situations, commands without the '%n' pattern are refused. For the excellent efax package by Ed Casas, the following are working:
  a)
Simply send the fax and wait for it... 
 
Ted.faxCommand: ( ( fax send '%n' '%f'; rm '%f' ) ) 
  b)
Send the fax, do not wait but mail a report to the sender... 
 
Ted.faxCommand: ( ( fax send '%n' '%f' 2>&1; rm '%f' 2>&1 ) | mail -s 'Fax %t' mark@localhost ) >/dev/null 2>&1 & 
The environment variable APP_FAX_TO also relates to faxing. Refer to the section on printing. 
 
customPrintCommand: A command to print through a custom printer command. Refer to the paragraph on printing for details.
customPrinterName: The name that is used to designate the custom printer command on the Print Dialog. Refer to the paragraph on printing for details.
customPrintCommand2, customPrinterName2: To configure a second custom printer.
printDialogShowPlacementDrawing: Some laptops have microscopic screens. Setting this resource to 0 hides the diagram that shows the placement of the document pages on the sheets of paper. This is to make the dialog a lot lower and to fit on the screen of this kind of computer.
defaultAnsicpg: The number of the codepage that is assumed when a document does not contain an 'ansicpg' rtf tag. It is also used when new documents are made. In general it is not desirable to set this resource without installing appropriate fonts. Only a few codepages are really supported. If you want me to support your codepage. I need your active help to provide me with example documents and to test my progress.
showTableGrid: By default, Ted draws a grid to show the structure of tables without borders. If you set this resource to 0 no grid will be drawn.
ghostscriptFontmap: The name of the file in which GhostScript keeps its fontmap. It is used to derive the X11 font name from the PostScript one when all other ways fail. It is also used to know what fonts to include in Teds printed output. Refer to the section on adding fonts for more details. E.G: /usr/share/ghostscript/6.53/lib/Fontmap.GS. Use the gs -h command to find the exact location.
ghostscriptFontToXmapping: The name of the Type1 to X11 font map in the GhostScript font directory. It is used to derive the X11 font name from the PostScript one when all other ways fail. Refer to the section on adding fonts for more details. E.G: /usr/share/ghostscript/fonts/fonts.dir. Use the gs -h command to find the exact value.
fontDirectory: The directory where Ted looks for fonts to include (embed) in its printed documents. Refer to the section on adding fonts for more details. Use the gs -h command to find the exact value.
supportXvCopyPaste: Set this resource to 1 to enable copy/paste with John Bradley's xv program.
usePostScriptFilters: PostScript levels 2 and 3 support the concept of filters. Filters make it possible to code the images in a PostScript file much more efficiently. You can activate this option when you have a printer that supports level 2 filters and the /FlateDecode filter. Recent versions of GhostScript support both. If you doubt, just activate the option and see whether you can still print images. To activate set the value to 1.
usePostScriptIndexedImages: PostScript level 2 has a variant of the image operator that makes it possible to include images with a color indirection via a palette in the PostScript file. As many if the images included in rtf documents are of this kind, setting this resource can help you to reduce the volume of the PostScript that is sent to the printer. All level 2 implementations, including GhostScript support indexed images. If you doubt, just activate the the option and see whether you can still print images. To activate set the value to 1.
skipBlankPages: If this parameter is set to 1, Ted skips blank pages while printing. Pages that are completely empty will not be printed. If the document has headers and footers, the relevant headers and footers will be printed on the page and the page will not be blank.
skipEmptyPages: If this parameter is set to 1, Ted skips empty pages while printing. Pages that are completely empty will not be printed. A page is not considered to be empty if it actually is empty, but the document has headers and footers. Under many circumstances the page would contain a header and a footer and it will be printed.
omitHeadersOnEmptyPages: If this parameter is set to 1, Ted will not print the page headers and footers on pages that do not contain any text from the document body or from notes. By design, this property interacts with the skipEmptyPages and skipBlankPages in the following surprising way: If both omitHeadersOnEmptyPages and skipBlankPages are set, a page without any body content will not be printed at all. However, if both omitHeadersOnEmptyPages and skipEmptyPages are set, a page without any body content will be printed as an empty page.
fontList:
Strictly speaking this is not a Ted, but a Motif property. It sets the font for the menu options and buttons. As this is a Motif resource, it follows the syntax of X11 font names. the fontList parameter is indispensable in a resource file that translates the Ted messages to a language that uses a special encoding. The following is an example value: -adobe-helvetica-bold-r-*-*-*-100-*-*-*-*-iso8859-2. As Ted*fontList is not a Ted property but a Motif property, it cannot be set in the /usr/local/Ted/Ted.properties or $HOME/.Ted.properties files. 
 
27) Command line arguments
Ted can be invoked as follows. Details of the majority of the calls are given in various sections of this manual. The calls that use the X11 window system support the call arguments given on the X(1) manual page. The arguments are omitted in the summary below. The X11 column tells whether the Ted invocation uses the X11 windowing system or not.
Command
X11
Meaning
Ted
yes
Show initial window with menu options to open files.
Ted file1.rtf file2.txt ..
yes
Open the files on the command line.
Ted --Find pattern f1.rtf f2.txt
yes
Open the files on the command line and search for pattern.
Ted --RegFind pattern f1.rtf f2.txt
 
Open the files on the command line and search for pattern. Pattern is a regular expression.
Ted --TtfToAfm x.ttf y.afm
no
Make an afm file that describes a true type font.
Ted --TtfToPt42 x.ttf y.t42
no
Convert a ttf font to PostScript type 42 format.
Ted --AfmToXFontsDir a.afm fonts.dir.extra
no
Read an afm file and write the directives for an X11 fonts.dir file for every encoding that both Ted and the font support. You must replace the string FontFileName in the output with the file name of the actual font file. The output is written to the fonts.dir.extra file. Use a dash for the file names to read/write from/to standard input/output. If the afm is unsuitable, Ted gives some diagnostics.
Ted --AfmToGSFontmap a.afm fontmap.extra
no
Read an afm file and write the directives for a GhostScript Fontmap file. You must replace the string FontFileName in the output with the file name of the actual font. The output is written to the fontmap.extra file. Use a dash for the file names to read/write from/to standard input/output.
Ted --RtfToPs < x.rtf > y.ps
no
Convert an rtf file to PostScript format.
Ted --RtfToPsPaper A4 < x.rtf > y.ps
no
Convert an rtf file to PostScript format. The PostScript is meant for printing on paper with the given size.
Ted --version
Ted ++version
no
yes
Show the version of Ted.
Ted --platform
Ted ++platform
no
yes
Show the platform for which Ted was built.
Ted --build
Ted ++build
no
yes
Show the host and the date where Ted was built.
Ted --fullVersion
Ted ++fullVersion
no
yes
Show version, platform and build.
Ted --saveTo f1.rtf f2.txt
Ted ++saveTo f1.rtf f2.html
no
yes
Read a file and save it in a different supported format.
Ted --printToFile x.rtf y.ps
Ted ++printToFile x.rtf y.ps
no
yes
Convert a document to PostScript. Format for the default paper format.
Ted --printToFilePaper x.rtf y.ps
Ted ++printToFilePaper x.rtf y.ps
no
yes
Convert a document to PostScript. Format for the paper size given.
Ted --print x.rtf
Ted ++print y.rtf
no
yes
Print the document on the default printer. Format for the default paper size.
Ted --printPaper x.rtf a4
Ted ++printPaper y.rtf letter
no
yes
Print the document on the default printer. Format for the paper size given.
Ted --printToPrinter x.rtf lp1
Ted ++printToPrinter y.rtf lp2
no
yes
Print the document on the printer given. Format for the default paper size.
Ted --printToPrinterPaper x.rtf lp1 letter
Ted ++printToPrinterPaper y.rtf lp2 legal
no
yes
Print the document on the printer given. Format for the paper size given.
Ted --setProperty property value ....
-
Sets the property to a value. In a command line run the effect is that of setting Ted.property: value in one of the configuration files. The command line arguments have priority over the values that come Teds configuration files. Settings from the X11 system overrule those from the command line. You can augment any invocation of Ted with as many --setProperty arguments as you want to. Unknown properties are silently ignored.
 
 
 
28) How to use Ted in your language
This section describes how you can translate the texts on the Ted windows and where you can install translations. Ted uses the X11 resources mechanism both for its configuration and for translated messages. The details of the X11 resources mechanism are a tedious subject. Fortunately most details are irrelevant if you just want to translate the Ted messages to your language. If you want to install translated Ted messages for yourself or for all users of your computer you do not need to know the details either. In the section on configuring Ted I give some additional details. The comments in the example Ted configuration file are yet a little more elaborate. The X11 documentation and books on Unix/Linux system management remain the ultimate source of information on the X11 configuration mechanism.9 Theoretically you could use Teds private configuration mechanism to provide the translated texts. As the translation is used by the user interface it is better to use the X11 resources mechanism.
 
Suppose you want to use Ted in the Erewhonian language. The first step is to obtain translated messages. Inspect the value of the LANG environment variable and check the Ted download site for an Erewhonian resource file. Let us assume that LANG=eg_ER. If an rpm package is available, just install it and all files end up in the correct location. If they are installed with the installTed.sh script, the same applies for the language specific Ted_eg_ER.tar.gz packages. After a manual installation of one of the Ted_eg_ER.tar.gz packages, you will find a file /usr/local/Ted/ad/Ted_eg_ER.ad.tar on your computer. Unpack the file with tar in the / directory. Whatever you have done to install a standard Ted language package, you should now have a file /usr/lib/X11/eg_ER/app-defaults/Ted on the computer. Users with the correct LANG=eg_ER should now see Ted in Erewhonian. Evidently installing an Erewhonian resource file Ted_eg_ER.ad file as /usr/lib/X11/eg_ER/app-defaults/Ted would have done the same thing.
 
Now suppose Ted is not as popular in your country Zembla as it is in Erewhon. This means that you have to make a translation yourself. Check the value of the LANG environment variable. On correctly configured Zemblan Unix/Linux systems LANG=zz_ZZ. The Ted distribution contains an example resource file /usr/local/Ted/Ted.ad.sample. It is an X11 resource file that contains all resource values that are compiled into Ted as defaults. Copy the file to some private directory. Call it Ted_zz_ZZ.ad. Ted_zz_ZZ.ad is the starting point of your translation of the Ted windows to Zemblan. Open the file in a plain text editor like vi or emacs. Change all values you want to change. As you intend to translate the file to Zemblan you only change the texts that Ted shows on its windows. You leave the other values alone. Probably it is even better to delete the lines that do not give user interface texts. The Ted program uses suitable default values for all values that are not given in the resource file. In addition to the window texts please enter following values to identify the translator:
Ted.localeTranslatedTo: zz_ZZ
Ted.localeTranslatorName: Charles Kinbote
Ted.localeTranslatorEmail: V.Botkin@wordsmith.edu
As Zembla is a civilized country that uses the Metric System and ISO A4 size paper also override the American defaults that are compiled into Ted:
Ted.unit: cm
Ted.paper: a4
Please leave configuration settings alone. Remember that you are translating the window texts. You are not trying to impose your personal taste upon others. Just delete the lines with configuration settings from the file. As your translated texts have an influence on the size of the Ted windows, try to be concise. The Microsoft Word at a Glance booklets are translated to almost any language. They are not only a good reference to Word but also an excellent source of phrases and window texts.
 
To test your file while you work on your translation use the command xrdb -merge < Ted_zz_ZZ.ad. The next time that you start Ted the windows will be in Zemblan independently of the LANG setting. Once you are ready you can install the translated Ted_zz_ZZ.ad file as /usr/lib/X11/zz_ZZ/app-defaults/Ted. I would be delighted to get a copy of your Ted_zz_ZZ.ad file for the Ted distribution.
 
Now that you have started to translate Ted related texts, you could as well translate the full manual: Copy /usr/local/Ted/TedDocument-en_US.rtf to /usr/local/Ted/TedDocument-zz_ZZ.rtf and translate the file. When you have finished the translation tell Ted to use the Zemblan translation for Zemblan users. Insert the value
Ted.documentFileName: /usr/local/Ted/TedDocument-zz_ZZ.rtf
in the Ted_zz_ZZ.ad file and deploy it again. You can imagine that the translated manual is as welcome in the Ted distribution as the translated window texts.
 
Finally, Zemblan uses the Latin2 character set. This means that you will have to tell Motif to use a Latin2 X11 font for the menu options and buttons etc. The following resource setting might be a good value: *fontList: -adobe-helvetica-bold-r-*-*-*-100-*-*-*-*-iso8859-2. For some more information refer to the example resource file. For a real explanation refer to the Motif and X11 documentation.
 
29) Using more fonts with a Ted installation
By default Ted is configured to use the Times, Symbol and Courier fonts in the Latin1 character set. To render documents with other fonts Ted uses rather crude heuristics to substitute one of the available fonts for the document fonts. On one hand this approach avoids font configuration issues. On the other hand it limits the the rendering and editing possibilities of Ted. As the standard afm files that come with Ted only support a limited number of font encodings, you will have to use afm files that describe the additional characters in other encodings. The somewhat more experienced user can extend the collection of fonts that are available in Ted. This section of the manual explains how to configure your environment to use more fonts than those in the basic set from Ted. Unfortunately the availability of fonts does not depend on the Ted configuration only. To edit a document on screen, an acceptable mapping from the fonts in the document to those that are used on screen must be possible. To print the document, or to convert it to Acrobat PDF format, the fonts must be available for the printing system or the PostScript to PDF conversion software. On Linux the GhostScript software is used for both. In this document I will not discuss the various issues with the configuration of GhostScript and the X11 Window system in detail. If the simple procedure does not work, refer to the various font related HOWTO documents and to the GhostScript documentation. The strong suggestion of this section is to use the GhostScript fonts with Ted whenever you believe that the basic font configuration is insufficient. Additional sets of reasonable quality fonts come with the Sun java runtime environment and staroffice/openoffice.
 
Below I describe different ways to extend the collection of fonts that can be used from Ted. I will begin with the ones that involve only little system administration and I will end with a complete integration of Ted with the GhostScript system. Unfortunately, the more advanced options involve more elaborate computer system administration. Before I describe how to configure Ted and its environment, I will provide some background explanation. The explanation is not absolutely necessary to know how to configure fonts. Nevertheless, I hope that it will help you to understand the purpose of the steps in the recipes below.
 
Sources for Font Names
Every rtf Document contains a font list: A list of the names of the fonts that are used in the document. To display or to print a document a text processor program like Ted or MS-Word uses the fonts in the document font list if they are available. If the fonts are not available, fonts that can be found on the computer are substituted for the fonts in the document. Ted uses very crude heuristics to substitute fonts. Your printer and GhostScript use crude heuristics as well. The heuristics may very well differ and the result will be ugly.
Another source for font names is the collection of fonts that are available to Ted. To be more precise it is not the collection of fonts but a collection of font descriptions. The fonts are described by Adobe Font Metric files. (afm files) The configurable parameter Ted.afmDirectory points to the directory where Ted reads its afm files. Ted opens all afm files in the directory and decides whether the fonts that are described by the files are usable. Apart from the syntax, Ted also checks the set of characters in the font. Ted only uses fonts that contain all characters in one of the standard character sets that Ted wants to use. If none of the character sets is supported by the font, the font us useless and Ted ignores it. Ted shows the names of the fonts in the document font list and the font names it found in the afm files in the font tool. As explained above, Ted uses crude heuristics to match fonts from the afm files to the ones in the document font list. With an acceptable set of afm files this usually succeeds. This means that the document can be formatted and converted to a PostScript file. Unfortunately this does not mean that that the document can be displayed on screen, or that it can be printed on any printer. Additionally, the crudeness of the font matching heuristics could be less than satisfactory to you.
 
Adding more Font Metric Files
If you add more afm files to Teds afm file directory you tell Ted that those fonts are available and you provide sufficient information to Ted to format documents on the basis of the descriptions that you have provided. Every afm file is accepted as the absolute truth: The font is mentioned so it exists. For acceptable results when the document is printed, the font or a substitute must eventually be available. Ted uses the Full name and the FamilyName of the PostScript font to match it to the document font. It uses the FontName to print. As you are the source of the information, you can easily tweak it a little to influence Teds behavior. Suppose that your document uses the Garamond font and that you did not yet buy the Garamond font from Adobe. On the short term you want to use the Palatino font as a substitute. [Or rather the very similar 'URW Palladio L' font that comes with GhostScript. See p052003l.afm.] You copy the Palatino.afm file to a file called FakeGaramond.afm in Teds afm directory. [You can use any name. The extension must be .afm] In the copy you replace the values of FullName and the FamilyName fields with names that lie that the font is a member of the Garamond font family. You leave the FontName intact: you want Ted to use the substituted font on the printer. If you want to use GhostScripts font map mechanism, you can change the FontName as well. But that is the subject of one of the following paragraphs. The Ted distribution contains an example shell script gsafm.sh that copies the GhostScript afm files to the Ted afm directory. It replaces the names of the fonts with the standard Adobe base 35 names. In summary: With extra afm files you can provide information on extra fonts. If you tweak them, you can use them to influence the way in which Ted matches PostScript fonts to document fonts. As long as your printing system (printer or GhostScript) accepts the FontName values from the afm files you can format them and print them using the correct fonts. To display additional fonts on screen a little more is needed. Finally, if the information in an afm file does not match the font, your print out can be ugly. The afm file is a description of an available font. If the font is not available, or it is different, the results will be ugly. Do not give Ted afm files for fonts that your printer or GhostScript does not support. Please note that the procedure described in this paragraph is a mechanism to provide PostScript replacement fonts for the fonts listed in rtf documents.
 
Matching X11 fonts to PostScript Fonts
Again: Ted uses crude heuristics to match fonts. For the base set of afm files that come with Ted, the heuristics usually work. If you add afm files to your installation the heuristics that are based on the FullName and FamilyName values are likely to fail. You will need to tell Ted what screen fonts to use for the PostScript fonts that it knows about from the afm files. You can provide this information in the file xfonts.dir. The location of the xfonts.dir file is in Teds afm directory. The default location is /usr/local/afm. You can give an alternative location with the Ted.afmDirectory parameter. The format of the file is very similar to the fonts.dir file that is used to provide PostScript fonts to the X11 window system. [Below we will see that sometimes Ted uses actual fonts.dir files.] The most important differences are that the initial line with the number of fonts is ignored by Ted and that the first column of the file does not contain the PostScript font file name but the FontName value from the afm file. E.G:
fonts.dir: ZapfChancery-MediumItalic -URW-Chancery L-medium-i-normal--0-0-0-0-p-0-iso8859-1
xfonts.dir: z003034l.pfb -URW-Chancery L-medium-i-normal--0-0-0-0-p-0-iso8859-1
The implicit assumption is that the fonts are scalable X11 fonts. [They are if you copy the lines from an existing fonts.dir file!] Previous versions of the Ted documentation mentioned the possibility to replace the zero sizes in the X11 string with asterisks. This is still possible but please do not use this feature in new files.]
 
Using GhostScript font mapping
A GhostScript installation has at least three font mapping mechanisms. One is internal to GhostScript and should be irrelevant for this discussion. [For the curious: See gs_fontmap.ps in the GhostScript distribution.] The two that I want to discuss are the FontMap file and the fonts.dir file that makes the fonts in the GhostScript distribution available to the X11 Window system. Though the xfonts.dir file is not a GhostScript file in the strict sense, it resides in a GhostScript directory and Ted uses it in conjunction with the Fontmap file that is part of GhostScript. The file /usr/share/ghostscript/6.53/lib/Fontmap on my computer is the GhostScript font map file. It includes the file Fontmap.GS in the same directory. Fontmap.GS contains two kinds of lines: (1) Lines that map a PostScript name to a PostScript name. Both start with a slash. The line ends in a space and a semicolon. (2) Lines that map a PostScript name to a PostScript string. The name starts with a slash, the string is in parentheses. The line ends in a space and a semicolon. (3) Additionally font map files can contain include lines that map a PostScript string to the token .runlibfile. The string is in parentheses. (4) Finally empty lines and comments starting with a % sign are ignored. GhostScript is rather fidgety about the syntax of these files. Refer to Fontmap.GS for details on the syntax.
Suppose that you have decided to buy the Garamond fonts and that the software comes in eight files: gar.afm, gar.pfb, gari.afm, gari.pfb, garb.afm, garb.pfb, garbi.afm and gabi.pfb. Copy the eight files to the GhostScript font directory. E.G. to /usr/share/ghostscript/fonts. Inspect the afm files and remove superfluous carriage return and the possible ^Z at the end. After this look at the FontName fields in the afm files. Note that the value of FontName in gar.afm is AGaramond-Regular and that you want to use the font as Garamond-Regular as well. To achieve this add the following lines to the Fontmap file:
/AGaramond-Regular (gar.pfb) ;
/Garamond-Regular /AGaramond-Regular ;
/AGaramond-Bold (garb.pfb) ;
/Garamond-Bold /AGaramond-Bold ;
etc...
In summary: You have told GhostScript to use the pfb files for the fonts and to that the AGraramond fonts can be used when a PostScript file refers to a Garamond font. This is sufficient to make the fonts work with GhostScript. Below I will show how Ted can use the GhostScript font mapping to derive even more from it. If the Ted afm directory is different from the GhostScript font directory copy the afm files to the Ted afm directory. [If you add fonts to GhostScript, it is often best to use the GhostScript font directory as the Ted afm directory.] Note, that though the GhostScript Fontmap files are the preferred mechanism, that GhostScript, like Ted uses its own font mapping heuristics. For some more detail, refer to line 476 of the file /usr/share/ghostscript/6.53/lib/gs_fonts.ps.
 
Using GhostScript Fonts on Screen
On most Linux systems, the X11 Window system is configured to use the PostScript fonts that come with GhostScript as X11 fonts. If this is not the case refer to the various font related HOWTO documents. A detailed explanation is beyond the scope of the Ted documentation. To check use the xfontsel utility. If it shows the name of the German design company urw in the list of foundries, you have a good chance that the GhostScript fonts are in the X11 font path. Supposing that the GhostScript fonts are available via the X11 font path, we can make the Garamond that we fonts we have installed available to be used on screen. Open the file /usr/share/ghostscript/fonts/fonts.dir and add the following four files ar the bottom.
gar.pfb -adobe-garamond-medium-r-normal--0-0-0-0-p-0-iso8859-1
gari.pfb -adobe-garamond-medium-i-normal--0-0-0-0-p-0-iso8859-1
garb.pfb -adobe-garamond-bold-r-normal--0-0-0-0-p-0-iso8859-1
garbi.pfb -adobe-garamond-bold-i-normal--0-0-0-0-p-0-iso8859-1
Finally, increment the number on the first line of the file by four as you have added four lines to the file. [The number is the number of fonts defined in the file.] Now you have to tell the X11 display system that you have added fonts. On a system without a font server use the command xset fp rehash to do so. If you use an X11 font server, you will have to tell the X11 font server as well. Consult the various font related HOWTO documents for details. If you are really desperate you can reboot the machine to effectuate your changes. Now you have finished the installation of your fonts. Unfortunately Ted does not yet know how to use them. NOTE that X11 requires the first line to only contain the number of fonts in the rest of the file. All other lines must contain the name of a font file and a valid X11 font name. Empty lines are not allowed. If the file format is incorrect, X11 ignores certain fonts without any diagnosic messages.
 
Font Encodings
In the paragraph above, I have ignored the fact that there are more characters in the world than the 200 in the Latin1 character set. Ted uses different character sets for different languages, both to produce compact PostScript printout and because the X11 Window display system does so. For every encoding, the xfonts.dir and fonts.dir files must give the correct encoding values. (The last two fields.) Ted uses the following encodings on screen: Fonts with diffrent encodings might be accepted by Ted. The result is rarely optimal and not officially supported.
Font Encoding
X11 encoding
Latin 1
iso8859-15 if all characters are in the font. otherwise iso8859-1.
Latin 2
iso8859-2
Symbol
adobe-fontspecific
Cyrillic
iso8859-5
Dingbats
urw-fontspecific
Greek
iso8859-7
Turkish
iso8859-9
Baltic
iso8859-13
 
Tell Ted about the GhostScript Mappings
Had Ted known about the font mapping in GhostScript and about the X11 fonts that are derived from the GhostScript fonts, it could have used the information to find an X11 font with every PostScript font that is supported by GhostScript. The recipe is simple: (1) Use the GhostScript Fontmap to find the name of the PostScript font file. (2) Use the fonts.dir file to find the name of the X11 font that is derived from the PostScript font file. You can tell Ted about the GhostScript font files by giving the following X11 resource values: (Adapt to your situation)
Ted.ghostscriptFontmap: /usr/share/ghostscript/6.53/lib/Fontmap.GS
Ted.ghostscriptFontToXmapping: /usr/share/ghostscript/fonts/fonts.dir
Now all correctly configured GhostScript fonts should be available with Ted as well. Use the gs -h command to find the exact location of the GhostScript files.
 
Font Embedding
The fact that you have the fonts on the hard disk of your computer does not necessarily mean that you can use the fonts on your printer. If you print with GhostScript, you probably do not need to do anything to make printing of non-standard fonts possible: You have installed them for GhostScript and GhostScript takes care of the printing. If you use a real PostScript printer, it may very well be possible that the fonts that you just have installed are not known to the printer. So you have to make them known to the printer. Evidently you could have uploaded them to the printer, (See below) but Ted can also embed the fonts in the printout of your document. Ted will embed fonts in the printout if it is configured to do so. All pfa, pfb (Type 1) and ttf (TrueType) true type fonts that can be included will be included. Type 1 fonts in pfa format are directly included. Type 1 fonts in pfb format are converted to pfa format. TrueType fonts are converted to PostScript Type 42 format. Most modern PostScript engines, including GhostScript, support Type 42 fonts. To embed fonts, Ted uses the GhostScript Fontmap and the fontDirectory resource. Ted uses the GhostScript Fontmap to find the name of a font file in the font directory. Every pfa, pfb or ttf file that can be found in that way will be included in the PostScript that Ted emits. To set the font directory set the X11 resource Ted.fontDirectory. E.G: Ted.fontDirectory: /usr/share/ghostscript/fonts is a good value. Use the gs -h command to find the exact location of the GhostScript fonts. All GhostScript pfa, pfb and ttf fonts will be included in this way. I have discovered that on some occasions, TrueType fonts that are embedded in the form of type 42 fonts give suboptimal results when the printout is converted to Acrobat pdf format with GhostScript. If you are experiencing this problem, you can convert your TrueType fonts to PostScript type 1 fonts with the ttf2pt1 utility. Use the -a flag to include all glyphs and the -b flag to convert to a real pfb font. The pfb fonts that come from ttf2pf1 have the disadvantage that they are often too complicated for the X11 font rendererer. That makes them unsuitable to be used on screen for Ted. A rather painful work-around exists. It is described below. An example for some of the hard work is given in the ttfdirpfb.sh example job that comes with the Ted distribution.
 
True Type Fonts
Both GhostScript and Ted support TrueType fonts. Suppose that you bought the Garamond fonts as TrueType fonts and not as PostScript type1 fonts. [Evidently you are far too honest to steal the files Gara.TTF, Garabd.TTF and Garait.TTF from the C:\Windows\Fonts directory of an MS-Windows computer.] You miss the BoldItalic variant and the afm files. For every file make a call to Ted --TtfToAfm Gara.TTF Gara.afm to make an afm file. Complain to your supplier about the BoldItalic variant. Install the files in the GhostScript font directory and follow the procedure that we outlined. The FontName does not have an A in front, so you do not want to define an alias this time. To make your life easy, Ted inserts suggested fonts.dir and ghostscript Fontmap lines in comments at the bottom of the afm file. The fact that this is possible and easy does not necessarily mean that it is allowed. Check the license of the TrueType fonts before you install them in GhostScript and you use them with Ted. BTW do not forget the font count in the fonts.dir file or to call xset to tell the X11 Window system about your fonts. The Lucida true type fonts that come with the Sun java runtime environment are easy to obtain and make a good test case for this procedure. An additional advantage of the Lucida Sans fonts is the number of encodings that they support.
 
Using the GhostScript afm Files
From the above it is clear that Teds own afm directory is no more than a bootstrap. The GhostScript font directory contains the the fonts and the afm files for good fonts. And Ted can use them. If you really want to use a font you probably want to install it in GhostScript anyway and then you have to copy the afm file to the Ted afm directory. Why not use the GhostScript fonts directory as the Ted afm directory? Indeed why not? The reason is that it complicates the Ted installation: The installer has to look for the GhostScript directory. Besides the contents of the GhostScript fonts directory are not that clean: (1) It contains two cyrillic afm files that Ted cannot use: The Ted afm reader does not complain about these two files but ignores them silently. (2) The URW++ fonts that replace the standard Adobe base 35 font set look very much like the Adobe fonts but they have different names. Ted wants to show the standard names in the font chooser. For this reason it replaces the FullName and the FamilyName of the URW++ fonts with the standard Adobe names while it reads the afm files. After you are sure that Ted is successfully installed, make the Ted.afmDirectory setting point to the GhostScript font directory. E.G: Ted.afmDirectory: /usr/share/ghostscript/fonts. Use the gs -h command to find the exact location of the GhostScript afm files. Use the GhostScript pf2afm command to obtain afm files for fonts that come without one. If you add fonts to GhostScript that do not support any of the font encodings that Ted prefers to use, Ted will complain about the font. Before you really use the font do some extra testing to see whether the font is usable with Ted.
 
Example jobs
The Ted distribution comes with example jobs that show how to obtain the files, or slices of the files that are needed to integrate fonts into Ted and into GhostScript. Though the jobs certainly are not fool-proof, they can help a lot to avoid typos while doing the hard work and to get an idea of what to do. Each of the jobs assumes that you run them in a directory with fonts. Each of the jobs will create a directory called derived. All derived files will be stored in this directory. The jobs will create an afm file for every file and two additional files for the configuration of X11 and GhostScript. fonts.dir.extra is a slice for the fonts.dir file for the X11 server. Fontmap.extra is a slice for the GhostScript Fontmap file. It is your responsibility to copy the files to the correct location and to include the two slices in the correct files. Do not forget to update the number of fonts on the first line of the fonts.dir file. Use pfadir.sh to derive configuration from all ascii format PostScript fonts in the current directory. Use pfbdir.sh for the binary format PostScript fonts and ttfdir.sh for all TrueType fonts. Please note that the jobs will destroy any file or directory that is called derived. Save a previous version before you run the jobs. To cope with the situation that GhostScript sometimes falls back to bitmap fonts when it uses TrueType fonts, and that the X11 server often chokes on the fonts that ttf2pt1 creates from TrueType fonts, a rather painful is possible. In this setup Ted embeds pfb fonts in its printout and X11 uses the TrueType fonts on screen. NOTE that it might not be legal to convert a font from one format to another. Check the license that you have to use a font before you convert it to a different format. The ttfdirpfb.sh example job does some of the hard work: (1) It converts a directory of TrueType fonts to pfb format. (2) If makes a Fontmap.extra slice for the GhostScript Fontmap file. (3) If makes a fonts.dir.extra slice for an X11 fonts.dir file. The assumption is that the *.ttf TrueType files are installed in a dirctory with fonts for X11. You can add the slice to the local fonts.dir file. (4) It makes a fonts.dir.ted.extra slice for an alternative fonts.dir file. Ted will use the GhostScript fontmap to find out what native font file is used for a certain font. As, to help X11, we use the TrueType *.ttf fonts rather than the PostScript *.pfb fonts on screen, Ted will not find the matching X11 font for a pfb file in fonts.dir as X11 uses TrueType fonts. To help Ted, we need another file similar to fonts.dir. Call it fonts.dir.ted. It contains the pfb font file names rather than the ttf font file names. In this way, we tell Ted what X11 fonts match the pfb fonts. To make Ted use the file set the Ted.ghostscriptFontToXmapping Ted property to the name of the fonts.dir.ted file. I know that this is painful. Unfortunately we have to live with the limitations of our environment.
 
Summary
A full integration with the GhostScript fonts can be realized by setting four resources in your $HOME/.Ted.properties file, or any other file that sets X11 resources. The exact names of the GhostScript files vary between Unix and Linux distributions. Use the gs -h command to find out. In a recent Debian distribution, the following values worked:
Ted.ghostscriptFontmap: /usr/share/ghostscript/6.50/lib/Fontmap.GS
Ted.ghostscriptFontToXmapping: /usr/share/fonts/type1/gsfonts/fonts.dir
Ted.afmDirectory: /usr/share/fonts/type1/gsfonts
Ted.fontDirectory: /usr/share/fonts/type1/gsfonts
 
Example with ttfdirpfb.sh
The following example will install the Lucida font that come with the Java JRE to be used with GhostScript and with Ted. The purpose of the example is to show how to use TTF fonts. I do not suggest that every step in the process is a legal action. To know whether you have the right to convert the Lucida fonts to pfb format, and to know whether you have the right to use the fonts with any software other than the Java JRE, you must consult Sun Microsystems. The example below is an illustration of the possibilities. It does not recommend to use the Lucida fonts with Ted. It does not suggest that it is legal to use the Lucida fonts with Ted either. So.. as an illustration and as an experiment:
1)
Locate the Lucida fonts that come with the Java Runtime Environment. On an older Linux installation, the fonts ended up in /usr/lib/SunJava2-1.3.1/jre/lib/fonts. 
2)
Obtain the ttf2pt1 utility. If it is not on your machine get it from http://ttf2pt1.sourceforge.net. 
3)
Make a directory /tmp/Lucida. Copy the Lucida font files to /tmp/Lucida. /tmp/Lucida will now contain the following 12 files: 
LucidaBrightDemiBold.ttf, LucidaBrightDemiItalic.ttf, LucidaBrightItalic.ttf, LucidaBrightRegular.ttf, LucidaSansDemiBold.ttf, LucidaSansDemiOblique.ttf, LucidaSansOblique.ttf, LucidaSansRegular.ttf, LucidaTypewriterBold.ttf, LucidaTypewriterBoldOblique.ttf, LucidaTypewriterOblique.ttf, LucidaTypewriterRegular.ttf
4)
In /tmp/Lucida, run the ttfdirpfb.sh job. A directory /tmp/Lucida/derived is created. It contains several files that you will use below. 
5)
Copy font files and metric files to the GhostScript fonts directory: (This step and the subsequent ones must be done as root!) 
cp /tmp/Lucida/*.ttf /usr/share/fonts/type1/gsfonts 
cp /tmp/Lucida/derived/*.afm /usr/share/fonts/type1/gsfonts
cp /tmp/Lucida/derived/*.pfb /usr/share/fonts/type1/gsfonts
Make sure that all copied files are readable for all users. (chmod 644 ...) At this point, Ted will see the afm files and list the fonts in the font tool.
6)
Make the new pfb fonts available to GhostScript. (It will not produce nice PDF with the ttf fonts.) Open the file /usr/share/ghostscript/6.50/lib/Fontmap.GS and include the file /tmp/Lucida/derived/Fontmap.extra at the end. [First make a backup of the original file.] Unless you know what you are doing, exactly copy the the contents. E.G: Do not remove the space before the semicolon at the end of the lines. 
7)
Separate X11 and Ted font configuration: 
cp /usr/share/fonts/type1/gsfonts/fonts.dir \
/usr/share/fonts/type1/gsfonts/fonts.dir.ted
Make sure that the copy is readable for all users. (chmod 644 ...).
Edit the Ted.properties file to refer to the copy:
Ted.ghostscriptFontToXmapping: /usr/share/fonts/type1/gsfonts/fonts.dir.ted
8)
Add the ttf fonts to the X11 configuration. (The pfb fonts are too complicated for X11) Open /usr/share/fonts/type1/gsfonts/fonts.dir and include the contents of /tmp/Lucida/derived/fonts.dir.extra at the bottom of the file. Update the number in the first line of the file to the number of lines minus one. [First make a backup of the original file.] Use the command xset fp rehash to make the X11 server pick up the new fonts or just restart X11. Unless you know exactly what you are doing, do not interfere with the lines that you add and do not create any empty lines. Check that the number in the first line is the number of lines in the file minus one. 
9)
Add the pfb fonts to the Ted configuration. This will tell Ted what X11 fonts to use for the pfb fonts. Open /usr/share/fonts/type1/gsfonts/fonts.dir.ted and include the contents of /tmp/Lucida/derived/fonts.dir.ted.extra at the bottom of the file. It is not absolutely necessary to update the number in the first line of the file to the number of lines minus one. [First make a backup of the original file.] Unless you know exactly what you are doing, do not interfere with the lines that you add and do not create any empty lines. 
 
Example with ttfdir.sh and a non-standard font
1)
Obtain the file marvosym.zip from http://www.marvosym.de. From the web page you already see that this is not just yet another funny text font. This is a valid excuse for the fact that the font cannot be encoded in any of the standard encoding that Ted fully supports. 
2)
Create a directory /tmp/marvosym. Unzip marvosym.zip into the directory. You now have a file called /tmp/marvosym/marvosym.ttf.  
3)
In /tmp/marvosym run the example stript ttfdir.sh. The script makes a directory /tmp/marvosym/derived with configuration files. It also complains about a duplicate character mapping. Ignore the complaint.  
4)
Copy font metric file to the GhostScript fonts directory: (This step and the subsequent ones must be done as root!) 
cp /tmp/marvosym/*.ttf /usr/share/fonts/type1/gsfonts 
cp /tmp/marvosym/derived/*.afm /usr/share/fonts/type1/gsfonts
Make sure that the copied file is readable for all users. (chmod 644 ...) At this point, Ted will see the afm file and list the MarVoSym font in the font tool. Ted does not like fonts that do not support any of the standard encodings that Ted supports. To show its dislike Ted complains about the font every time it starts. Ignore the complaints about the encoding of the MarVoSym font.
5)
Make the new ttf font available to GhostScript. Open the file /usr/share/ghostscript/6.50/lib/Fontmap.GS and include the contents of the file /tmp/marvosym/derived/Fontmap.extra at the end. [First make a backup of the original file.] Unless you know what you are doing, exactly copy the the contents. E.G: Do not remove the space before the semicolon at the end of the lines. 
6)
There is no need to separate X11 and Ted configuration for this particular font. To add the ttf font to the X11 configuration, open /usr/share/fonts/type1/gsfonts/fonts.dir and include the contents of /tmp/marvosym/derived/fonts.dir.extra at the bottom of the file. Update the number in the first line of the file to the number of lines minus one. [First make a backup of the original file.] Use the command xset fp rehash to make the X11 server pick up the new fonts or just restart X11. Unless you know exactly what you are doing, do not interfere with the lines that you add and do not create any empty lines. Check that the number in the first line is the number of lines in the file minus one. 
7)
If you use a separate GhostScript to X11 font mapping for Ted, also update the mapping file for Ted. I.E: if the Ted.ghostscriptFontToXmapping property does not refer to /usr/share/fonts/type1/gsfonts/fonts.dir, add the ttf font to the mapping file for Ted. Refer to the previous example for details. So if you use separate files, because a different font gives bad results from ttf, you must modify both the file for X11 and the file for Ted. 
8)
Now the MarVoSym symbol font will more or less work. Ted will complain about the non-standard encoding of the font. The X11 font server will only render certain characters. I do not know why. It might be that the characters are too complicated, or that the non-standard encoding of the font confuses the server. Documents that use the font will however be printed correctly and the printout will be successfully converted to Acrobat PDF. 
 
30) Uploading fonts to a PostScript printer
After you have extended the collection of fonts that can be used on your computer, you might want to print documents that use the extra fonts as well. Though the obvious way is to make Ted embed the fonts in the document, it is really easy to upload a collection of fonts to your printer. In a directory that contains the fonts you want to upload in either something.pfa format or in something.pfb format give the following shell command:
 
 
(
echo serverdict begin 0 exitserver
cat *.pfa *.pfb
) | lpr
 
Until the printer is turned off it will support the fonts from your font files.
 
Most modern PostScript printers support TrueType fonts that are uploaded to the printer. To be uploaded, they must be wrapped in a so called type 42 PostScript font. To support uploading of ttf fonts to your printer, Ted can convert TrueType fonts to PostScript type 42 fonts. Use the command Ted --TtfToPt42 someFont.ttf someFont.pf42 to convert a font to type 42 format. and use the recipe above to upload the someFont.pf42 file to your printer. The fact that this is possible does not necessarily mean that it is allowed. Check the license of the TrueType font before you convert it to type 42 format and you upload it to your printer.
 
31) Nuisances with Window Managers
Ted was originally developed as a Motif application. Most of the testing has been done with the Motif Window Manager mwm and with Gnome and KDE. If you use an experimental or a primitive 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. 
·
In some instances the File -> Save As text window or the Margins text windows, in Page Layout, will not focus when clicked on. You cannot enter text except that the dialog be lowered and then raised again. Alternately switching desktops causes the mouse to focus on the text dialog. This can happen if you are using Xfce's Xfwm window manager. In the case of Xfce, the problem can be solved by changing from the default "click to focus" to "focus follows mouse". To do that: 
1) Click on Xfce's settings icon (the toolbox icon) 
2) Click on Window Manager. 
3) Click on the "Keyboard and Focus" tab. 
4) Finally, click on the radio button that says "Focus follows mouse".  
If You cannot enter any text in a text box after you have used a combobox then you should move the mouse to the taskbar momentarily. Then click on the text window and it should now be active, so that you can type text. 
 
Upto a certain point, Ted can support session managers like those of KDE or CDE. When the session manager tells Ted to save its state and it allows Ted to interact with the user, Ted ask the user whether she wants to save her work just as when she wants to quit the application and Ted retires from the session. If no interaction is allowed, Ted saves unsaved documents to the directory $HOME/.Ted and tells the session manager to restart it with special command line options to reload the unsaved documents.
 
32) Shell widget names
With primitive window managers, it might be necessary to set Geometry resources for Shell windows to avoid the interactive placement of the different Ted windows. Shell names are given below.
 
 
Ted makes two kinds of Shell windows:
·
Some windows are modal dialogs: Until you dismiss them, you can only input data into the dialog. All dialog windows have 'Ok' and 'Cancel' buttons that dismiss them. 
·
Some windows are tools: They are on the screen and adapt themselves to to the current situation all the time. It is up to you to decide to use them or not. Tool windows disappear behind windows that you raise after you used the tool. (Usually behind a document window.) So there is no need to explicitly dismiss a tool. It depends on the window manager whether you can dismiss a tool window or not. 
 
Windows and tools: To avoid offensive behavior of primitive window managers, it might be necessary to set Geometry resources for them.
Application window Ted
Document window tedDocument
Find Tool tedFindTool
Spell Tool tedSpellTool
Insert Symbol Tool tedSymbolPicker
Format Tool tedFormatTool
Modal Dialogs: Even with primitive window managers, no Geometry resources should be necessary.
Bookmark Dialog tedBookmark
Print Dialog tedPrintDialog
Mail Dialog tedMailDialog
Property Dialog tedPropertyDialog
Message Dialog tedMessageDialog
 
So including the line 'tedDocument*geometry: 600x800' in $HOME/.Xdefaults or $HOME/Ted will limit the initial size of document windows to 600 pixels wide and 800 pixels high. Note that these are pure X11 resources and that Teds own configuration mechanism can not be used to set widget geometry.
 
33) 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 not always 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'
 
The vertical scrollbar of a document window can be controlled with the mouse wheel as it can be configured in XFree86. Include the line ZAxisMapping 4 5 in the pointer section of a version 3.x XF86Config file, or the line Option "ZAxisMapping" "4 5" in the InputDevice section of a 4.x XF86Config file. Both have been tested with IMPS/2 protocol mice.
 
 
Similar remarks apply for other X11 versions.
 
34) Compiling Ted from source
To compile and link Ted, get the source code from the download site ftp://ftp.nluug.nl/pub/editors/ted. Unpack the archive and follow the instructions below. If you use other Unix versions than Linux, realize that the construction of a distribution package uses the gzip compression utility and the chown root:root syntax. Although statically linked executables of Ted run on any X Windows system, to compile and link, you need a motif development environment. If you do not have one you can use LessTif, a free motif implementation. Ted has been tested with LessTif, and though there are a few peculiarities, the combination of Ted and LessTif works quite well. LessTif is available from http://www.lesstif.org. Alternatively you can use the Open Motif distribution by the open group refer to http://www.opengroup.org/openmotif.
Ted 2.17 can be compiled with the GTK+ 1.2.10 toolkit or a later version. The GTK version is not complete and should be seen as step in the right direction. Not as a finished piece of software. Jouk Jansen made fixes to the Ted source to compile on Compaq OpenVMS. Jouk is the author of the mysterious config.mms files that are the makefiles for the VMS make system.
 
Apart from a motif development environment, you might need one or more of the public image libraries that Ted uses.
·
Libtiff by Sam Leffler. If you do not have it, download it. 
·
Libjpeg by the independent JPEG group. If you do not have it, download it. Version 6 is required. If the link stage complains about undefined symbols like jpeg_std_error, you are using version 5. 
·
Libpng by the PNG group. If you do not have it, download it. You will also need zlib by Jean-loup Gailly and Mark Adler. If you do not have it, download it. 
·
LibXpm by Arnaud Le Hors of Groupe Bull. If you do not have it, download it. 
 
 
I want to express my gratitude to the authors of all the free software libraries I have used for Ted. Without them, a project like Ted would have been impossible.
 
Unpacking the source archive results in a Ted-2.17 directory. The compilation procedure has some support for graphics libraries that are not preinstalled on the system. It assumes that they are installed in the Ted-2.17 directory, that a link from a generic name to a version dependent one exists, and that the library has been successfully compiled. Compiling the executable is simply done with the command make in the Ted-2.17 directory. There is no need to call configure as this is done by make. You can change some compilation options by editing the top level makefile. Refer to the comments in the top of the file. When make is successful, there is a Ted executable in the Ted directory. To make an installation package, call make package. If you do not use gnu tar, this must be done as root. The installation package tedPackage/Ted_<platform>.tar.gz is now ready. To install it on your machine, call make install. Installation must be done as root. (Or by a system user with sufficient permission to install software in /usr/local.) Those that cannot perform the last steps as root can call make private to get a private installation. The make private call will suggest the necessary modifications to your .Xdefaults or .Xresources file to run from a private installation. The ultimate possibility is to copy the Ted executable to a suitable location and to unpack the relevant files from the tedPackage/TedBindist.tar archive. Refer to the sections on installation and configuration for details.
 
 
On some platforms, in particular Sun Solaris, no static Motif and X libraries are available. For those platforms, and for shared library zealots, the alternative make targets compile.shared, package.shared and install.shared are available. The Ted executables made in this way use shared libraries.
 
35) Making spelling dictionaries for Ted
 
On the Ted web site, or in the source directory of the CD you can find two example programs that build a spelling dictionary for Ted. On the basis of these examples, it should not be too difficult to build a Language.ind file. If you install this file in your private dictionaries directory, or in the system wide one, 'Language' will appear in the spelling tool and you can check spelling in that Language. For the locations to install Language.ind files, see the section on configurable resources.
 
 
To use the examples, you will need
·
The example source code. 
·
The ispell material is used in the example on how to make a checker from an affix file and dictionaries. It can be found on ftp.cs.ucla.edu. 
·
The French épelle material is used in the example on how to make a checker from a flat list of words. The French spelling material can be obtained from ftp://ftp.inria.fr. 
For a list of ispell dictionaries that might be converted, and the original ispell material refer to the ispell site.
 
36) Acknowledgments
 
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, rather than on 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 ftp.cs.ucla.edu (131.179.128.34). 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 Björn Jacke. It is available from http://www.suse.de/~bjacke/igerman98. It is an adaptation of the material by Heinz Knutzen to the new German orthography rules. The material of Heinz Knutzen is available as ftp://ftp.informatik.uni-kiel.de/pub/kiel/dicts/hk-deutsch.tar.gz. 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 ftp://ftp.fi.upm.es/pub/unix/espa~nol.tar.gz. 
·
The Portuguese ispell material is that of Ulisses Pinto & José João Almeida, Universidade do Minho. It is available as ftp://http://www.di.uminho.pt/~jj/pln/UMportugues.tgz. 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 by ftp from ftp://ftp.inria.fr. 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 many words and adapted the material to the new orthography rules. The original material is available as ftp://donau.et.tudelft/pub/words/groen. 
·
The Italian spelling material is based on the dictionary and affix file by Marco Roveri available from the directory ftp://ftp.mrg.dist.unige.it /pub/mrg-usr/marco/ispell. 
·
The Czech spelling material is based on the dictionary and affix file by Petr Kolar available from the directory ftp://ftp.vslib.cz/pub/unix/ispell. 
·
The Danish spelling material is based on the dictionary and affix file by Jacob Sparre Andersson available via http://da.speling.org/installation/ispell. 
·
The Swedish spelling material is based on the dictionary and affix file by Göran Andersson and the Skåne/Sjælland Linux User Group available via http://www.sslug.dk/ispell/iswedish/swedish.html. 
·
The Norwegian spelling material is based on the dictionary and affix file by Rune Kleveland available via http://www.uio.no/~runekl/dictionary.html. 
·
The Polish spelling material is based on the dictionary and affix file by Piotr Gackiewicz and others available from ftp://ftp.ds14.agh.edu.pl/pub/ispell/. 
·
The Slovak spelling material is based on the dictionary and affix file by Zdenko Podobný available from http://spell.linux.sk/ispell.html. 
·
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 ftp://ftp.cs.toronto.edu/pub/regex.shar.Z. 
·
The perfect hash generator and the hash functions that it uses are borrowed from public domain software by Bob Jenkins: http://burtleburtle.net/bob/hash/perfect.html. 
·
The possibility to directly send mail from Ted is based on code by my friend and ex colleague Rob Vonk. 
·
Jean Peyratout translated the resource file to French. The first French translation was by Odile Bénassy of the TINY Linux project. 
·
Peter Ivanyi and Jozef Kosik translated the resource file to Slovak. 
·
Kenneth Bernholm translated the resource file to Danish. 
·
Kristof Petr not only translated the resource file to Czech but also contributed a lot to the support of Latin 2 alphabets in Ted. 
·
Eric Lecluse and Hans Harder translated the resource file to Dutch. 
·
Axel Schwarzer translated the resource file to German, then translated the manual and found and reported more bugs than I ever expected in Ted. 
·
Dina Ratsimbazafy translated the resource file and the manual to Malagasy. 
·
Peter Feher translated the resource file to Hungarian. 
·
Jakub Bogusz translated the resource file to Polish. 
·
Cárlisson Galdino translated the resource file to Brazilian Portuguese. 
·
Simen Graaten translated the resource file to Norwegian. 
·
Marcelo Daniel Arroyo translated the resource file to Argentinan Spanish. César Fraile translated it to Castillian Spanish. 
·
Jouk Jansen Ported Ted to OpenVMS and contributed the fixes he had to make. 
·
Jeffrey Boser patiently tested many Ted versions and reported many bugs. 
·
Jonathan Drews is the Free BSD maintainer of Ted. He has been a great help and support. He looked into many issues and patiently tested my intermediate results. Jonathan patiently reported all my bugs and provided moral support whenever the work seemed too much for me. 
·
John Murdie contributed man(1) pages for Ted, rtf2pdf.sh and rtf2ps.sh 
 
 
For some types of picture files, public source code was used.
·
Support for TIFF pictures is implemented with Sam Leffler's libtiff. It is available from ftp://ftp.uu.net/graphics/tiff. 
·
Support for PNG pictures is implemented with the PNG groups libpng. Source is available on ftp.uu.net in the directory /graphics/png. libpng in its turn uses zlib by Jean-loup Gailly and Mark Adler for the compression of the data. The official zlib ftp site is ftp://ftp.uu.net/pub/archiving/zip/zlib/. 
·
Support for JPEG pictures is implemented with the Independent JPEG groups libjpeg. It is available from ftp.uu.net in the directory graphics/jpeg. 
·
Support for XPM pictures uses libXpm by Arnaud Le Hors of Groupe Bull. Source is available from ftp://ftp.x.org/contrib. 
·
Support for GIF pictures was borrowed from libgif by Gershon Elber and Eric S. Raymond. For more information refer to the giflib home page: http://prtr-13.ucsc.edu/~badger/software/giflib.shtml. 
·
A considerable part of the TrueType font support in Ted was derived from the ttf2pt1 project source code. Even where the Ted code substantially differs from the ttf2pt2 implementation, it has been a great help and a source of inspiration. I am grateful to Andrew Weeks, Mark Heath and others for their project. 
·
Matyas Koniorczyk helped a lot to finally get the support for Latin2 in a state that is actually usable with Slovak. 
 
 
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.
 
37) Author
 
Mark de Does
http://www.mdedoes.com
<IMG>
January 23 2005
More or more recent information on Ted might be available from the Ted web site http://www.nllgg.nl/Ted. The latest versions and the source code from ftp://ftp.nluug.nl/pub/editors/ted.
P.S.
Please do not insert my mail address in web pages that refer to me or to Ted. Plain text email addresses are automatically harvested from the web to send unsollicited email. You can either refer to the web page or use an image. 

1 Some of the ignored information is not saved either when you modify and then save an RTF document with Ted.
2 Please read the compilation instructions at the end of this document before you start compiling Ted. They are short and easy.
3 Please refer to the explanation at the end of this document.
4 Theoretically other applications might support it: selection=PRIMARY, target=application/rtf; the contents of the window property that is exchanged is a complete rtf document.
5 Theoretically other applications might support it: selection=PRIMARY, target=image/png; the contents of the window property that is exchanged is a complete png picture.
6 This is the default location. To use a different location, refer to the Ted.spellToolSystemDicts resource.
7 The mail is addressed to the To recipient and evidently she gets it. Cc (Carbon Copy) recipients will get the mail, and they will be mentioned in the headers of the mail message. I.E. all the recipients can see that the mail was sent to the Cc recipients. Bcc (Blank Carbon Copy) recipients will also get the mail, but they will not be mentioned in the headers of the mail message so others cannot see that the message was sent to the Bcc recipients.
8 Exceptions are made for the Shell widgets. With primitive window managers, it might be necessary to set Geometry resources for them. The names of the Shell widgets are given below. Additionally some properties of the XmFileSelectionBox that Ted uses to open and to save files are configurable. The font that Ted uses on in the menu and on its tools is also configurable with X11 resources.
9 Short of an alternative even GTK versions of Ted use the X11 resources mechanism. As for the GTK version I had to reimplement it with low level X11 calls, some of the less common steps in the search path for resources are not implemented in GTK versions of Ted.