Comment: 1,0:00:00.00,0:00:00.00,Default,,0,0,0,template line ABC,{\shad0\t($sstart,$send,\clip(!$sright+line.styleref.outline*0.5!,!$stop-line.styleref.outline!,!$lright+line.styleref.outline!,!$sbottom+line.styleref.outline!))}
和kf相比主体和边框都变
$left的值是否包括边框的值
尽量使用的半角的空格,不然位置的计算可能会出现误差。
同这个帖子http://forum.aegisub.org/viewtopic.php?f=13&t=70259
2,http://forum.aegisub.org/viewtopic.php?f=13&t=70158
ci[]数组的作用和原理
很多youtube上代码都有的 字符计数
ci[1] is similar to syl.i. syl.i is syllable index but ci[1] is character index.
syl.i is defined by automation4 , but automation4 neither defines nor counts character index. so you have to define and count it on your own.
char_couter is a function to count character index. this function does not return anything but stores index number to table ci for later reference.
as you know char class template is executed number of characters.
char_counter counts the index of the current character at every time and stores it to table ci.
example : single use
code once : function char_counter(ref) ci[ref] = ci[ref] + 1 return "" end
code line : ci = {0}
template char : !char_counter(1)!!retime("start2syl",(ci[1]-1)*50,0)!
example : multiple use in same style
code once : function char_counter(ref) ci[ref] = ci[ref] + 1 return "" end
code line : ci = {0,0}
template char : !char_counter(1)!retime("start2syl",(ci[1]-1)*50,0)!
template char : !char_counter(2)!retime("start2syl",(ci[2]-1)*50,0)!
you have to use different key to store a separate index number for every template.
4,http://forum.aegisub.org/viewtopic.php?f=13&t=69891
元音字符和非元音字符使用不同的效果
you cannot do it with fxgroup, but can do around it.
code syl : define fxarray table and set if each character of syllable is vowel or not.
tempalte char : call charsyl_counter to get current character's index and look up fxarray with the index.
if fxarray is true, call fxvowel function to get actual output line for vowel character else call fxconso function .
Comment: 0,0:00:00.00,0:00:00.00,Default,,0,0,0,code once,function fxvowel() return "\\1c&HFF00FF&" end
Comment: 0,0:00:00.00,0:00:00.00,Default,,0,0,0,code once,function fxconso() return "\\1c&H00FF00&" end
Comment: 0,0:00:00.00,0:00:00.00,Default,,0,0,0,code syl,csi = {0} fxarray = {} i = 1 for c in _G.unicode.chars(syl.text_stripped) do fxarray[i] = string.match(c,"[aiueoAIUEO]") i = i + 1 end
Comment: 0,0:00:05.00,0:00:05.00,Default,,0,0,0,template char,!charsyl_counter(1)!{\an5\pos($center,$middle)!fxarray[csi[1]] and fxvowel() or fxconso()!}
!retime("syl",0,0)!{\an5\move($scenter,$top,!$si == #line.kara and line.right + syl.width/2 or line.left+line.kara[syl.i+1].center!,$top)\org(!-1000+$right!,$top)\t(0,!line.duration/2!,\frz2)\t(!line.duration/2!,!line.duration!,\frz0)\p1}m 21 30 b 0 30 0 0 21 0 b 41 0 41 30 21 30 m 21 6 l 19 12 l 12 12 l 18 16 l 15 23 l 21 18 l 27 23 l 24 16 l 30 12 l 23 12