- UID
- 2
- 积分
- 8682
- 帖子
- 2905
- 主题
- 199
- 论坛币
- 11739
- 威望
- 16
- EP值
- 2349
- MP值
- 15
- 阅读权限
- 200
- 注册时间
- 2011-8-3
- 在线时间
- 2597 小时
- 最后登录
- 2024-8-28
|
View it online: TCC File Format Specification
or download as doc: tcc-spec.doc
or view it here:
TCC File Format Specification
Version 1.0 – Date: 15th September, 2010
Revision - Date: 4th August, 2011
Introduction
TCC stands for TC Configuration. TCC File Format is specially designed for the TCAX project. It is a XML-like structured plain text with the filename extension .TCC (consider of an .ini file). It is aimed to configure a TCAX FX project. The attributes contained in a TCC file are pre-defined, and are unlikely to be changed in the future. Some of the attributes are used in TCAX internally, while some will simply be passed to the user’s tcaxPy scripts.
Details
A very general example of TCC file format can be:
<name = value> <na me = “v=lu
e” >
<tcc version = 1.0> <font name = HEITI>
<font file name = C:\Windows\Fonts\semhei.ttf>
Content between ‘<’ and ‘>’ including ‘<’ and ‘>’ themselves is called an element of TCC file, also called a TCC attribute. All the elements of TCC file are placed between ‘<’ and ‘>’, the two special characters are called internal markups of TCC file, they can only be used as markups. The two markups must appear in pairs, and cannot be nested. And one ‘=’ must be in each pair of ‘<’ and ‘>’, the ‘=’ in quote will not be regarded as markup. ‘<’ ‘=’ ‘>’ should be in one line, note that we regard multiple lines in a quote as a single line. ‘value’ can be put in a quote, but ‘name’ cannot, all characters can be put in quote except ‘<’ and ‘>’. All characters outside the element scope will be ignored including ‘=’ and quote. The content is made up by three parts: ‘name’ ‘=’ and ‘value’, white spaces between ‘<’ and ‘name’, ‘name’ and ‘=’, ‘=’ and ‘value’, ‘value’ and ‘>’, and any characters outside ‘<’ and ‘>’ will be ignored. All white spaces in ‘value’ are significant while that in ‘name’ is not, that is to say, all white spaces between two non-white-space characters will be converted to a half white space. Here white space includes half or full white space and tab. Attributes are only defined by their names, their position in TCC file and their order are of no importance, however, the order of attributes with the same name is significant. TCC File Parser is not case sensitive.
TCC Version 1.0 with detailed descriptions
# tcc file version
< tcc file version = 1.0 >
# file version of TCC, indeed there is only one version of TCC, and should be kept as 1.0
# mode configuration
< inherit ass header = false >
# indicate whether to inherit the header of the karaoke-timed ASS file to the output ASS file, or to make a new ASS header using settings from the TCC file.
< k mode = syllable >
# the value can be word (or normal) / syl (or syllable) / adv (or advanced), they indicate three different modes of TCAX’s serving karaoke timings and texts. As you can guess, normal mode simply serves syllables just the same as what you see in the karaoke-timed ASS file, while syl mode will serve only one text a time with its derived karaoke timing, and adv mode serves no more than two texts a time with derived karaoke timing.
< text layout = horizontal >
# the value can be hori (or horizontal) / vert (or vertical), it’s the text layout of the TCAX FX.
< tcaxpy init = false >
# indicate whether to use tcaxPy_Init function in the user’s tcaxPy script, tcaxPy_Init function usually does some initialization, and it will be executed once before any other pre-defined functions of the tcaxPy script.
< tcaxpy user = false >
# indicate whether to use tcaxPy_User function in the user’s tcaxPy script, the function will be executed only once and if tcaxPy_User function is used, tcaxPy_Main function will be ignored. The difference between tcaxPy_User function and tcaxPy_Main function is that tcaxPy_Main function provides several pre-defined parameters, which are easy to use, and tcaxPy_Main function will be executed many times, while tcaxPy_User function left all the work to be done by the user.
< tcaxpy fin = false >
# indicate whether to use tcaxPy_Fin function in the user’s tcaxPy script, tcaxPy_Fin function usually does some finalization, and it will be executed once after any other pre-defined functions of the tcaxPy script.
# py settings
< py file = test1.py > < beg line = 1 > < end line = 0 > # 1 means the first line
< py file = test2.py > < beg line = 1 > < end line = 0 > # 0 means the last line
< py file = test3.py > < beg line = 1 > < end line = -1 > # -1 means the second line from the bottom
< py file = test4.py > < beg line = 1 > < end line = -2 > # -2 means the third line from the bottom
< py file = !\test.py > < beg line = 5 > < end line = 0 > # ‘!\’ or ‘!/’ indicates that ‘test.py’ is in the TCAX’s root directory
< py file = !\script\test.py > < beg line = 3 > < end line = 7 > # ‘test.py’ is in the ‘script’ folder of the TCAX’s root directory
# main settings
< k-timed ass file = test_k.ass >
# filename of the input karaoke-timed ASS file, if you leave this value empty, then, an empty SYL string will be generated automatically in the memory, this feature is to allow the users to use some special functions of TCAX, if the filename specifies a valid ASS file, then the ASS file should be a SYL file, refer to http://www.tcax.org/docs/syl-spec.htm
< font file = simhei.ttf >
# the font filename
< font face id = 1 >
# a font may contain several font faces, this number indicates which one to use
< font size = 40 >
# font size
< fx width = 1280 >
# horizontal resolution of the TCAX FX, usually it should be the same as the source video
< fx height = 720 >
# vertical resolution of the TCAX FX, usually it should be the same as the source video
< fx fps = 23.976 >
# FPS of the TCAX FX, usually it should be the same as the source video
< alignment = 7 >
# indicate where to put the texts, you can refer to the number keyboard. Default alignment for horizontal layout is an1, default alignment for vertical layout is an9
< x offset = 30 >
# horizontal margin, when alignment is 1 4 7 or 2 5 8, it is measured from the left side, otherwise from the right side.
< y offset = 15 >
# vertical margin, when alignment is 7 8 9 or 4 5 6, it is measured from the upper side, otherwise from the bottom side.
< spacing = 0 >
# spacing between texts
< space scale = 1.0 >
# factor that the length of a white space should be multiplied with.
# style settings
< font face name = "" > # you can simply leave this value empty
< bord = 1 > < shad = 0 >
< primary color = FFFFFF > < secondary color = 000000 > < outline color = FFFFFF > < back color = 000000 >
< primary alpha = 0 > < secondary alpha = 255 > < outline alpha = 0 > < back alpha = 255 >
# additional settings
< blur = 0 >
|
|