[Script Info]
Title: 10
Original Script: 10
ScriptType: v4.00+
PlayResX: 384
PlayResY: 288
ScaledBorderAndShadow: yes
YCbCr Matrix: None
[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: Default,Arial,16,&H00FFFFFF,&H00FFFFFF,&H80000000,&H80000000,0,0,0,0,100,100,0,0,1,1,0,2,10,10,10,1
[Events]
Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
Dialogue: 0,00:00:00.76,00:00:04.07,Default,,0,0,0,,Organic molecules discovered in an ancient galaxy.
Dialogue: 0,00:00:04.07,00:00:07.16,Default,,0,0,0,,How far are we from third contact?
Dialogue: 0,00:00:07.16,00:00:20.12,Default,,0,0,0,,It's been a year since Webb officially began its imaging mission, and many previously unphotographable images have recently been sent back. In early June, astronomers published this photo in the journal Nature.
Dialogue: 0,00:00:20.12,00:00:28.36,Default,,0,0,0,,A ring of orange light encircles a blue core. This is a galaxy-scale donut, a portal.
Dialogue: 0,00:00:28.36,00:00:43.91,Default,,0,0,0,,This is the birth ring of an alien civilization. Actually, it is an ancient galaxy containing organic polycyclic aromatic hydrocarbons, its name is SPT0418-47. Because the name is long, we will refer to it as SPT0418 below.
Dialogue: 0,00:00:43.91,00:00:45.92,Default,,0,0,0,,Doesn't seem much shorter.
Welcome to the powerful world of ASS subtitles! Unlike SRT subtitles, which only allow you to change the font and color, ASS (Advanced SubStation Alpha) lets you control every detail of your subtitles with designer-like precision. This guide will take you step-by-step to uncover its mysteries.
Part 1: Understanding Your ASS File
An .ass
file is essentially a plain text file that you can open with any text editor (like Notepad, VS Code). Its content consists mainly of three parts:
[Script Info]
: The script information section. This contains the metadata of the subtitle, such as the title, original resolution (PlayResX
andPlayResY
), etc. For beginners, the most important thing to pay attention to isPlayResX/Y
, which defines the size of the "virtual canvas" for subtitle layout.[V4+ Styles]
: The style definition section. This is the core of our learning today! It defines preset templates for all subtitle "appearances."[Events]
: The events section. This is the actual content of the subtitles, and each line of "Dialogue" contains the subtitle's appearance time, end time, content, and the style name it applies.
Core Logic: We define various styles (such as "dialogue style", "note style") in the
[V4+ Styles]
section, and then specify which style to use for each subtitle line in the[Events]
section.
Part 2: Unveiling the Core - [V4+ Styles]
Explained
In the style section, you'll see two key lines of information: Format:
and Style:
.
Format:
line: This is the header row, which defines the order of each parameter in theStyle:
rows below.Style:
line: This is the data row, containing all the parameter values for a specific style.
Below, we will analyze the most important parameters in the Style:
line one by one:
Parameter Name | Explanation | Example and Notes |
---|---|---|
Name | Style Name | Default , Note . A clear name for calling in the [Events] section. |
Fontname | Font Name | Arial , SimHei . Note: The viewer's computer must have the font installed for it to display correctly. |
Fontsize | Font Size | 28 , 50 . |
PrimaryColour | Primary Color | Core Parameter. The color of the text itself. |
SecondaryColour | Secondary Color | Mainly used for Karaoke effects, the color of the sung parts of the text. |
OutlineColour | Outline Color | Core Parameter. The color of the text's outline and shadow. |
BackColour | Background Color | Core Parameter. The background color of the box when BorderStyle=3 . |
Bold | Bold | 0 for No, -1 for Yes. |
Italic | Italic | 0 for No, -1 for Yes. |
Outline | Outline Width | Core Parameter. The width of the outline in pixels. 0 means no outline. |
Shadow | Shadow Distance | Core Parameter. The distance between the shadow and the text, in pixels. 0 means no shadow. |
Alignment | Alignment | Core Parameter. Uses the numeric keypad layout to define the position. Very important! |
MarginL , MarginR | Left and Right Margin | The minimum distance between the subtitle and the left and right edges of the screen. |
MarginV | Vertical Margin | The minimum distance between the subtitle and the top and bottom edges of the screen. |
Deep Understanding of Key Parameters
Color Format (
Colour
) The ASS color format is&H<AA><BB><GG><RR>
, the order is Transparency-Blue-Green-Red, all in hexadecimal.AA
(Alpha/Transparency):00
= Completely opaque,FF
= Completely transparent.80
is about 50% semi-transparent.- Examples:
&H00FFFFFF
: Pure white (opaque)&H00000000
: Pure black (opaque)&H000000FF
: Pure red (opaque)&H80000000
: Semi-transparent black
Alignment (
Alignment
) It uses the numeric keypad to control the subtitle's position in a 3x3 grid on the screen:7 (Top Left) 8 (Top Center) 9 (Top Right) 4 (Middle Left) 5 (Middle Center) 6 (Middle Right) 1 (Bottom Left) 2 (Bottom Center) 3 (Bottom Right)
2
is the most common bottom center.8
is often used for top notes.
Part 3: The Soul - Deep Dive into BorderStyle
The BorderStyle
parameter connects many of the above parameters and determines the final rendering mode.
BorderStyle = 1
: Standard Outline (Most Common)
- Meaning: Adds an outline and shadow to the text, with a transparent background.
- How it works: Enables the
OutlineColour
,Outline
, andShadow
parameters. - Use case: The default choice for all ordinary dialogue subtitles.
- Configuration points:
- Set
BorderStyle
to1
. - Set
Outline
> 0 (e.g.2
) to get an outline. - Set
Shadow
> 0 (e.g.1
) to get a shadow. - Define the color of the outline and shadow with
OutlineColour
.
- Set
BorderStyle = 3
: Background Box Mode
- Meaning: Adds a rectangular background box to the text, while disabling the outline.
- How it works: Enables the
BackColour
parameter, but completely ignores theOutline
parameter. - Use case: Karaoke, translator's notes, screen text that needs strong emphasis.
- Configuration points:
- Set
BorderStyle
to3
. - Define the color and transparency of the background box with
BackColour
. - [Important] For maximum compatibility, set
OutlineColour
andBackColour
to the exact same value!
- Set
BorderStyle = 4
: Precise Positioning Mode (Advanced)
- Meaning: A technical rule that ensures that the layout and positioning of the subtitles remain consistent on any screen.
- How it works: Forces all coordinate and dimension calculations to be based on the
PlayResX/Y
defined in[Script Info]
. - Use case: Advanced effects subtitles (ASS FX), complex typesetting, vector drawing.
- Configuration points:
- For effects that require precise positioning, set
BorderStyle
to4
. - If you also need an outline effect, you can set it to
5
(1+4
) to ensure compatibility across all renderers.
- For effects that require precise positioning, set
Part 4: Practical Exercises - "I want..." Configuration Recipes
Now, you can directly copy the following Style:
line code and replace the styles in your file to achieve the desired effect.
Recipe 1: The Classic "White Text Black Outline" Dialogue Subtitle
- Effect: White text, 2-pixel black outline, 1-pixel black shadow, bottom center.
- Code:
Style: Dialog-Classic,Arial,28,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,1,2,10,10,10,1
Recipe 2: Semi-Transparent Black Background "Note Subtitle"
- Effect: White text with a semi-transparent black background box, top center.
- Code (Note that
OutlineColour
andBackColour
are the same):Style: Note-Box,Arial,22,&H00FFFFFF,&H000000FF,&H80000000,&H80000000,0,0,0,0,100,100,0,0,3,1,0,8,10,10,10,1
Recipe 3: "Minimalist Subtitle" Without Any Borders or Shadows
- Effect: Pure white text, without any decoration, bottom center.
- Code:(Just set
Style: Minimalist,Arial,28,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,0,0,2,10,10,10,1
Outline
andShadow
to0
in aBorderStyle=1
style)
Recipe 4: Basic Style for "Effect Subtitles" Requiring Precise Positioning
- Effect: Same appearance as "White Text Black Outline", but with precise positioning mode enabled.
- Code:
Style: FX-Base,Arial,28,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,5,2,1,2,10,10,10,1
Part 5: Final Reminders - Common Pitfalls and Best Practices
- Compatibility Pitfall of
BorderStyle=3
: Again, when usingBorderStyle=3
, be sure to setOutlineColour
andBackColour
to the same value, otherwise the color may be inconsistent on different players. - Font Missing Issue: If your subtitle turns into SimSun font on someone else's computer, it is likely because they don't have the font you specified installed. Either choose a common font (such as Arial, SimHei), or package and share the font file together.
- Confusion with Color Codes: Remember that after
&H
is Transparency-Blue-Green-Red (AABBGGRR). Many online color pickers provide theRRGGBB
format, so you need to manually swap the positions of B and R when using them.
At this point, you have mastered all the core knowledge of customizing ASS subtitle styles. Now, feel free to experiment and combine these parameters to create your own beautiful and easy-to-read subtitles!