mirror of https://github.com/odrling/Aegisub
minor updates to the AS5 spec, mostly general cleaning and rewordings
Originally committed to SVN as r1407.
This commit is contained in:
parent
fae778e45b
commit
3272b51788
|
@ -102,31 +102,33 @@ termination mark; they always end at the start of the next one or at the end of
|
|||
\emph{Section names are case sensitive.}
|
||||
|
||||
Each section is divided in lines, each line representing one command or definition. Empty
|
||||
lines \must\ be ignored. It is recommended that programs generating AS5 files insert
|
||||
a blank line at the end of each section to increase readability. There \must\ always
|
||||
be a blank line at the end of the file (as every line is required to end in a line break).
|
||||
lines (that is, lines only containing a line ending) \must\ be ignored by the parser.
|
||||
It is recommended that programs generating AS5 files insert a blank line at the end of each
|
||||
section to increase readability. There \must\ always be a blank line at the end of the file
|
||||
(as every line is required to end in a line break).
|
||||
|
||||
Each line in a section takes the general form of \textit{Type: data1,data2,...,dataN}. An
|
||||
unknown \textit{Type} \must\ be ignored by a parser. It is recommended that subtitle
|
||||
editing programs keep such ignored lines in the file after re-saving it. Note that the space
|
||||
after the colon is \emph{mandatory}.
|
||||
unknown \textit{Type} \must\ be ignored by a parser. Subtitle editing programs \should\ keep
|
||||
such ignored lines in the file after re-saving it. Note that the space after the colon is \emph{mandatory}.
|
||||
|
||||
There are two sections which are required, \emph{[AS5]} and \emph{[Events]}, the former being
|
||||
the equivalent of \emph{[Script Info]} in previous formats. If either of those sections is
|
||||
missing, the file is deemed invalid and \emph(MUST) be refused by the parser. Any other section
|
||||
missing, the file is invalid and \emph(MUST) be refused by the parser. Any other section
|
||||
can be ommitted from the file, and need not be implemented by all parsers. However, any unknown
|
||||
section \must\ be preserved in the file by a subtitle editing program when it re-saves a
|
||||
file with sections that it does not recognize. It can, however, be removed at the user's discretion.
|
||||
|
||||
Finally, there is a special type of undefined group, \emph{[Private:PROGNAME]}, which
|
||||
\must\ be \emph{ENTIRELY} preserved by other programs when re-saving it. This is used to
|
||||
store program-specific data, for example, Aegisub would create a group called
|
||||
store program-specific data. For example, Aegisub would create a group called
|
||||
\emph{[Private:Aegisub]} to store its data inside. This type of group should be identified
|
||||
by the fact that it starts with \emph{"`[Private:"'}.
|
||||
|
||||
The sections \may\ be written in any order, with the exception of the \emph{[AS5]} section which
|
||||
\must\ always be the first section.
|
||||
|
||||
\subsubsection{[AS5]}
|
||||
This must be the first section in every AS5 file. If the very first line of the file is not
|
||||
This \must\ be the first section in every AS5 file. If the very first line of the file is not
|
||||
[AS5], the file \must\ be rejected by the parser as invalid. Note, however, that the first
|
||||
line is allowed to contain a Byte-Order Mark (BOM), which is the character U+FEFF encoded in
|
||||
the encoding used for the rest of the script\cite{Unicode BOM}. The first four bytes will therefore be:
|
||||
|
@ -155,10 +157,10 @@ video resolution, however, subtitles \must\ be rendered on such a coordinate spa
|
|||
640x480 script, \textbackslash{pos(320,240)} always represents the center of the script, no matter the
|
||||
resolution of the video it's being drawn on. Also, in a 100x100 script, a radius 50 circle centered on
|
||||
the center will always take half of the height and half of the width of the video, even if that means
|
||||
being distorted if drawn on a 640x480 video.
|
||||
being distorted if drawn on a video with a non-1:1 aspect ratio (for example, a 640x480 video).
|
||||
\end{itemize}
|
||||
|
||||
Also, the following items are not required, but are recommended. They all have default values:
|
||||
The following items \may\ also be used; they are not required, but are recommended. They all have default values:
|
||||
|
||||
\begin{itemize}
|
||||
\item Generator: The name of the program that generated this script, e.g. \textit{"`Generator: Aegisub"'}.
|
||||
|
@ -172,14 +174,15 @@ even if it means that the line will become unreadable because it goes outside th
|
|||
no extensions available. Renderers should read this to enable any extensions that they might support.
|
||||
Editing programs \must\ keep this field intact, unless the user chooses otherwise. Scripts WILL break
|
||||
if the list of extensions is suddenly lost.
|
||||
\item Credits: Credits for the people who worked on this subtitle file. Should be ignored by the renderer.
|
||||
\item Title: The title of this script. Should be ignored by the renderer. Subtitling programs may opt to display
|
||||
this title to the user.
|
||||
\item Credits: Credits for the people who worked on this subtitle file. Purely for informational purposes and
|
||||
\should\ be ignored by the renderer. Subtitling programs \should\ be able to display these credits to the user.
|
||||
\item Title: The title of this script. Purely for informational purposes and \should\ be ignored by the renderer.
|
||||
Subtitling programs \should\ be able to display this title to the user.
|
||||
\end{itemize}
|
||||
|
||||
Although any other lines are allowed in this group, this is not encouraged, as they might conflict
|
||||
with future revisions of the format. Instead, they should be stored in \textit{[Private:PROGNAME]} groups,
|
||||
as mentioned above.
|
||||
Unlike in the previous incarnations of the format, storing private data here is not allowed, which means
|
||||
that this section \must not\ contain any properties not listed here. Any application-specific or otherwise
|
||||
private data \must\ be stored in \textit{[Private:PROGNAME]} groups instead, as mentioned above.
|
||||
|
||||
|
||||
\subsubsection{[Events]}
|
||||
|
@ -195,26 +198,29 @@ time is \emph{inclusive}.
|
|||
\item End: The end time of the line. It follows the same format as the start time. The line is only
|
||||
displayed if the timestamp of the current frame is \emph{lesser than} the end time. That is, end time is
|
||||
\emph{exclusive}. In particular, it means that a line whose start time is equal to its end time will
|
||||
never be displayed. If the end time is lesser than the start time, the renderer may issue a warning,
|
||||
but should render the remaining lines regardless of the issue.
|
||||
\item Style: The name of the default style used for this line. See the [Style] section below. Should be
|
||||
left blank if you want to use the the script's global default style. If an unknown style is specified,
|
||||
the renderer \must\ fallback to default, and might issue a warning.
|
||||
never be displayed. If the end time is earlier than the start time, the renderer \may\ issue a warning,
|
||||
but it \should\ render the remaining lines regardless of the issue.
|
||||
\item Style: The name of the default style used for this line. See the [Style] section below. If left blank,
|
||||
the script's global default style \must\ be used. If an unknown style name is specified, the renderer \must\
|
||||
fallback to default, and \may\ issue a warning.
|
||||
\item User: This field is used by the program to store program-specific data in each line. Renderers
|
||||
should ignore this. This should be left blank if it's not used.
|
||||
\should\ ignore this (but \may\ use it for application-specific extension features). This field \should\
|
||||
be left blank if it's not used. Note that whatever data is stored here \must not\ contain any commas!
|
||||
\item Content: The actual text of the line. This contains actual text and override tags. See the section
|
||||
on override tags for more information.
|
||||
\end{itemize}
|
||||
|
||||
The timestamp format is h...h:mm:ss[.s...], that is, it begins with an integer of arbitrary length
|
||||
(up to a maximum of 4 digits) representing the number of hours, followed by a one-digit or two-digit integer
|
||||
representing minutes, and a floating point number representing seconds. Localization is irrelevant: a
|
||||
period ("`."') is always used to separate the decimal point. This way, 0:21:42.5 and 0000:21:42.5000 are
|
||||
equivalent, and both represent 0 hours, 21 minutes, 42 seconds and 500 miliseconds.
|
||||
representing minutes, and a floating point number representing seconds. Leading zeroes in the hours field \may\
|
||||
be ommitted. Localization is irrelevant: a period ("`."') is always used to separate the decimal point.
|
||||
This way, 0:21:42.5 and 0000:21:42.5000 are equivalent, and both represent 0 hours, 21 minutes, 42 seconds
|
||||
and 500 miliseconds.
|
||||
|
||||
Spaces between each field \must\ be ignored by all parsers. Any spaces at the beginning of the
|
||||
content line should be stripped. A hard space or empty override block should be used if space at the
|
||||
start of a line is truly desirable. That is, the two following lines are identical:
|
||||
content line \should\ be stripped by any editing program. A hard space (see the overrides section) or empty
|
||||
override block should be used if space at the start of a line is truly desirable. That is, the two
|
||||
following lines are syntactically identical:
|
||||
|
||||
\begin{verbatim}
|
||||
Line: 0:2:31.57 , 0:02:34.22 , , , Hello world of {\b1}AS5{\b0}!
|
||||
|
@ -230,8 +236,8 @@ simplified when compared to the previous formats, and now contains only three fi
|
|||
|
||||
\begin{itemize}
|
||||
\item Name: The name of this style. Style names are not case-sensitive, but \must\ be unique. A
|
||||
script with conflicting style names must be refused by the parser. If the style name is "`Default"', it
|
||||
will be used for all lines that ommit the style name. If there is no "`Default"' line, the renderer
|
||||
script with conflicting style names \must\ be rejected by the parser. If the style name is "`Default"', it
|
||||
will be used for all lines that omit the style name. If there is no "`Default"' line, the renderer
|
||||
default is used.
|
||||
\item Parent: The style from which the current style derives from. See below for more information.
|
||||
Leaving this field blank means that the style derives from the renderer's default style.
|
||||
|
@ -282,6 +288,10 @@ Style: Actor2,,\fn(Respublica)\fs24\bord2\shad2\4a#80\2c#000000\1c#FFB3CF
|
|||
Since all that deriving a style from another does is append the new tags to the end of the previous,
|
||||
this way of declaring styles is identical to the one above, but is more verbose.
|
||||
|
||||
If no Default style is defined, the renderer \must\ choose its own defaults to render the text with.
|
||||
These are entirely arbitrary and can be set to anything, but the renderer \should\
|
||||
let the user set his own defaults.
|
||||
|
||||
\addcontentsline{toc}{section}{References}
|
||||
\begin{thebibliography}{1}
|
||||
|
||||
|
|
Loading…
Reference in New Issue