Creating an STL Format Subtitle File

An easy and flexible way to create subtitle files is to use the STL format developed by Spruce Technologies. The STL format allows you to configure most subtitle settings, and change the settings on a subtitle by subtitle basis. It supports both the single file method and the graphics file method, and even allows you to use both methods in the same file.

STL format files can be saved as either plain text files or as RTF files (as created with TextEdit). You must use RTF files if your text contains Unicode characters.

Basic STL Format

There are three parts to an STL format subtitle file: commands, comments, and entries.

  • Commands: These are preceded by the dollar sign ($). It is these commands that allow you to configure the various aspects of the subtitles, such as their font and position. See STL Commands for more information.
  • Comments: These are preceded by a double slash (//). These allow you to add text comments throughout the subtitle file without affecting its import.
  • Entries: These include the start and end timecode values and the text or graphics file for that subtitle clip.

Following is an example of a simple STL subtitle file.

$FontName = Arial
$FontSize = 65
//The following subtitles are for scene one.
00:00:12:04 , 00:00:14:12 , Lemurs are the bullies of the wild.
00:00:16:14 , 00:00:19:08 , Here we see them bring down a moose.

Commands, which are always preceded by a dollar sign, use the equal sign (=) to separate the command name from its value. The entries use commas to separate their fields. In both cases, you can add tab characters to align the fields and make the file easier to read.

Note: If you add spaces between the comma and the text entry, they are considered part of the text and appear in the subtitle. You can use the tab character to provide space between the comma and the text entry without affecting the text.

You can add a command multiple times within a file to change a setting for specific subtitles.

$FontName = Arial
$FontSize = 65
00:00:12:04 , 00:00:14:12 , Lemurs are the bullies of the wild.
$FontSize = 50
00:00:16:14 , 00:00:19:08 , Here we see them bring down a moose.

In this case, both subtitles will use the same font, with the first one at a size of 65 and the second one at 50.

STL Commands

Following is a list of the commands supported by the STL format.

Note: These commands override the settings in DVD Studio Pro Preferences, which provide the default settings for all settings that have not been overridden.

Font Commands

The font commands set all commonly used font properties.

  • $FontName: Sets the name of the font the subtitles use. Use the family name as it appears in the Fonts window, which can be opened by clicking Show Fonts in the toolbar or choosing Format > Fonts > Show Fonts.
  • $FontSize: Sets the size of the font.
  • $Bold: Selects the bold version of the font (if available). Enter True to select the bold version and False to disable it.
  • $Italic: Selects the italic version of the font (if available). Enter True to select the italic version and False to disable it.
  • $Underlined: Adds an underline to the subtitle text. Enter True to turn on the underline and False to turn it off.

Color Commands

The color commands choose the colors from the default subtitle Color Palette to apply to the subtitle. The values range from 0 to 15. You can assign the colors to the default Color Palette in DVD Studio Pro Preferences.

  • $ColorIndex1: Chooses the text color.
  • $ColorIndex2: Chooses the text’s outline 1 color.
  • $ColorIndex3: Chooses the text’s outline 2 color.
  • $ColorIndex4: Chooses the background color.

Contrast Commands

The contrast commands set the opacity of the colors assigned to the subtitle. The values range from 0 (transparent) to 15 (opaque).

  • $TextContrast: Sets the opacity of the text color.
  • $Outline1Contrast: Sets the opacity of the text’s outline 1 color.
  • $Outline2Contrast: Sets the opacity of the text’s outline 2 color.
  • $BackgroundContrast: Sets the opacity of the background color. This is usually set to 0, unless you are using a graphic that does not use white as the background color.

Position Commands

These commands control the subtitle’s position.

  • $HorzAlign: Sets the subtitle’s horizontal alignment. You can enter left, center, or right.
  • $VertAlign: Sets the subtitle’s vertical alignment. You can enter top, center, or bottom.
  • $XOffset: Allows you to modify the subtitle’s horizontal position from where the horizontal alignment placed it. The values you enter are in pixels, with positive values moving the subtitle to the right and negative values moving it to the left.
  • $YOffset: Allows you to modify the subtitle’s vertical position from where the vertical alignment placed it. The values you enter are in pixels, with positive values moving the subtitle up and negative values moving it down.

Display Commands

These commands control how a subtitle displays.

  • $ForceDisplay: Forces the subtitle to display regardless of whether subtitles are turned on by the DVD player. You can enter True (subtitles are forced to display) or False (subtitle display is controlled by the DVD player).
  • $FadeIn: Sets the fade time used to gradually dissolve the subtitles on. Enter a value in frames.
  • $FadeOut: Sets the fade time used to gradually dissolve the subtitles off. Enter a value in frames.

Graphics File Command

Use this command if this subtitle file uses graphics files in addition to, or in place of, text entries.

  • $SetFilePathToken: Sets a token that you use on any subtitle entries that contain a graphics filename instead of subtitle text. The entry must be such that it never appears in normal text or filenames. The normal convention is to surround the text with dual angle brackets, making it easier to locate within an STL file. For example, you could use _Graphic_. See Referencing Graphics Files in STL Subtitle Files for details.

Timeline Command

By default, the timecode values in an STL file are in reference to the video stream’s zero-based time, which starts at 00:00:00:00. You can use this command to reference the file’s timecode values to the video stream’s asset-based timecode.

  • $TapeOffset: Controls how the timecode values in the STL file are referenced to the video stream. You can enter False to reference them to the stream’s zero-based timecode (which begins at 00:00:00:00), or True (the default setting) to reference them to the asset-based timecode.

Note: When referenced to the asset-based timecode, the Track Inspector’s Track Offset setting is ignored—only the actual asset’s timecode is used.

Controls Embedded in the Subtitle Text

You can embed several controls in the text part of the entries. These controls can force a line break and turn on and off the bold and italic font versions.

Line Breaks

Subtitle text does not automatically wrap at the edges of the screen. To make it fit you must either reduce the font size or break it into multiple lines by inserting line breaks. To insert a line break, add the vertical pipe character (|) to the text.

00:00:12:04 , 00:00:14:12 , Lemurs are the bullies | of the wild.

In the above example, the text will appear as two lines.

Bold, Italic, and Underlined Characters

You can embed controls that change the state of the bold and italic attributes within the text part of an entry.

To change the state of the bold setting, insert an up arrow followed by the letter “B” (^B).

00:00:12:04 , 00:00:14:12 , Lemurs are ^Bbullies^B.

In the above example, the bold status changes for the word “bullies” only. If the bold attribute had not already been activated, “bullies” would change to bold. If the bold attribute had already been activated, “bullies” would not be bold.

To change the state of the italic setting, insert an up arrow followed by the letter “I” (^I). You can also use bold and italic together.

00:00:12:04 , 00:00:14:12 , Lemurs are ^B^Ibullies^B^I.

In the above example, the word “bullies” has both the bold and italic attributes change.

To add an underline to portions of the text, insert an up arrow followed by the letter “U” (^U). You can use the underline along with the bold and italic settings.

Referencing Graphics Files in STL Subtitle Files

An STL subtitle file can contain a mix of text subtitle entries and references to graphics files. You must use the $SetFilePathToken command in the file before any lines that reference a graphics file.

$SetFilePathToken = _Graphic_
00:00:12:04 , 00:00:14:12 , _Graphic_RabidLemur.tif
00:00:16:14 , 00:00:19:08 , _Graphic_MooseLemur.tif

Important: Do not add spaces between the token (_Graphic_ in this example) and the filename.

The STL subtitle file and the graphics it references must be in the same folder. And, just like the other assets that you import into your project, the graphics files must not be moved, renamed, or deleted until after you build your project.