Documentation for the AscToRTF conversion utility

The latest version of these files is available online at

Previous page Back to Contents List Next page

Using Style Definition Files (SDF)

As of version 2.0, AscToRTF allows more control over the fonts used to add style to the document text.

Several users of AscToRTF are feeding output of typesetting software into AscToRTF as text input. In many cases these users commented that they had detailed knowledge of how the RTF should be formatted, but were having to discard that information in the text passed to AscToRTF, with a resulting loss of details.

Changes have been made in version 2.0 to allow better integration between the original document and the RTF created by AscToRTF.

These changes allow you to define various font styles in a Style Definition File and to then invoke these files by placing FO (font) tags into the source document.

You can choose to have a FO tag apply from that point onwards, until the next paragraph/heading/table or just until the end of the current input line. In any case a new FO tag will override the previous setting.

Contents of this section

Loading the Style Definition File (SDF)
An Example Style Definition File
SDF Line : define font

Loading the Style Definition File (SDF)

All the style definition information should be placed in a "Style Definition File" (SDF). By convention this file should have a ".inc" extension, but this isn't a requirement.

To have the file loaded, you will need to set a policy line in your policy file of the form

        [config files]
        Style Definitions file        :

This will normally appear in the "[config files]" section of your policy file, but again this isn't strictly necessary.

Once this option appears in your policy file, the style definition file will be loaded before the conversion process starts.

You can choose the Style Definition File by selecting the menu option

Conversion Options -> Configuration Files -> Style Definition File

This will take you to a dialog for Selecting the Style Definition File

An Example Style Definition File

At present only font declarations can be included in a Style Definition File. Below is a simple example that simply defines the three font styles Fixed, Heading and Body.

        define font : Fixed,    Courier New, regular, 10
        define font : Heading,  Arial, regular, 10
        define font : Body,     Times New Roman, regular, 10

See SDF line : define font

SDF Line : define font

The define font line defines a font that can be referenced by a FO tag in the source document.


        define font : <font_ID>, <Font_specification>


This is a unique name given to the font specification
as it will be used in the FO tag
This is the specification of the font to be used
whenever an FO tag references this font_ID.

The font_specification consists of a comma delimited list of the font name, the weight and the font size. This is the same format as described in the The Font Selection Dialog


define font : Fixed, Courier, bold, 12

This defines a font_ID called "fixed". This equates to a Courier font which is set bold and to be 12pt. If in my source text I add the tag

[[FO fixed,,14]]

The the following text will be Courier, Bold and 14pt (because the FO tag has overridden the specified font size).

See also Pre-processor command: FO

Previous page Back to Contents List Next page

Valid HTML 4.0! Converted from a single text file by AscToHTM
© 1997-2004 John A Fotheringham
Converted by AscToHTM