Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save tassa-yoniso-manasi-karoto/a7459110317db47fc81cea562dca7578 to your computer and use it in GitHub Desktop.

Select an option

Save tassa-yoniso-manasi-karoto/a7459110317db47fc81cea562dca7578 to your computer and use it in GitHub Desktop.

Default Style Values from Aegisub

Source Files:

  • Aegisub-master/src/ass_style.h (lines 42-65)
  • Aegisub-master/src/ass_style.cpp (line 48)
Field Default Value ASS-Formatted Value
Name "Default" Default
Fontname "Arial" Arial
Fontsize 48.0 48
PrimaryColour RGB(255,255,255), A=0 &H00FFFFFF (white, opaque)
SecondaryColour RGB(255,0,0), A=0 &H000000FF (red, opaque)
OutlineColour RGB(0,0,0), A=0 &H00000000 (black, opaque)
BackColour RGB(0,0,0), A=0 &H00000000 (black, opaque)
Bold false 0
Italic false 0
Underline false 0
StrikeOut false 0
ScaleX 100.0 100
ScaleY 100.0 100
Spacing 0.0 0
Angle 0.0 0
BorderStyle 1 1 (normal outline+shadow)
Outline 2.0 2
Shadow 2.0 2
Alignment 2 2 (bottom-center, \an style)
MarginL 10 10
MarginR 10 10
MarginV 10 10
Encoding 1 1 (Default charset)

Relevant Code Snippets

From ass_style.h (class member default initializers):

std::string name = "Default";
std::string font = "Arial";
double fontsize = 48.;

agi::Color primary{ 255, 255, 255 };   // white
agi::Color secondary{ 255, 0, 0 };     // red (karaoke)
agi::Color outline{ 0, 0, 0 };         // black
agi::Color shadow{ 0, 0, 0 };          // black

bool bold = false;
bool italic = false;
bool underline = false;
bool strikeout = false;

double scalex = 100.;
double scaley = 100.;
double spacing = 0.;
double angle = 0.;
int borderstyle = 1;
double outline_w = 2.;
double shadow_w = 2.;
int alignment = 2;
std::array<int, 3> Margin;  // initialized in constructor
int encoding = 1;

From ass_style.cpp (constructor initializes margins):

AssStyle::AssStyle() {
    std::fill(Margin.begin(), Margin.end(), 10);
    UpdateData();
}

Complete Default Style Line

When serialized (from UpdateData() in ass_style.cpp line 181-191), the default style produces:

Style: Default,Arial,48,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,0,0,0,0,100,100,0,0,1,2,2,2,10,10,10,1

Notes

  1. Color format: ASS uses &HAABBGGRR format (alpha, blue, green, red). Alpha 00 means fully opaque, Alpha FF means fully transparent.
  2. Boolean fields: When written to file, false becomes 0 and true becomes -1 (see line 187-188: (bold? -1 : 0)).
  3. Encoding: Value 1 corresponds to the "Default" charset (see GetEncodings() function at line 198).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment