- UID
 - 1102
 - 积分
 - 2126
 - 帖子
 - 36
 - 主题
 - 2
 - 论坛币
 - 219 
 - 威望
 - 20 
 - EP值
 - 44 
 - MP值
 - 0 
 - 阅读权限
 - 50
 - 注册时间
 - 2013-3-24
 - 在线时间
 - 64 小时
 - 最后登录
 - 2025-8-16
  
 
 
 
  
 | 
 本帖最后由 qwe7989199 于 2015-9-3 14:30 编辑  
几年 发表于 2015-9-3 00:16   
不想用an7的话你可以用shape.bounding 和 shape.move 处理一下,你画个长方形玩一下就知道怎么移了。 
改 ... - Comment: 0,0:00:00.00,0:00:00.00,1,Get Resolution,0,0,0,code once,xres, yres = _G.aegisub.video_size()
 
 - Comment: 0,0:00:00.00,0:00:00.00,1,cal pos based on an7,0,0,0,code line all,an = line.styleref.align                   if an == 1 or an == 2 or an ==3 then                    y = yres-line.styleref.margin_v-line.height                   elseif an == 4 or an == 5 or an == 6 then            y =math.round(yres/2-line.height/2)         else           y = line.styleref.margin_v         end         if an == 1 or an == 4 or an == 7 then          x= line.styleref.margin_l         elseif an == 2 or an == 5 or an == 8 then          x=math.round(xres/2-line.width/2)        else           x=math.round(xres-line.styleref.margin_r-line.width)         end
 
 - Comment: 0,0:03:15.08,0:03:17.08,1,Get Drawing,0,0,0,code line all,text=_G.decode.create_font(line.styleref.fontname, line.styleref.bold, line.styleref.italic, line.styleref.underline, line.styleref.strikeout, line.styleref.fontsize).text_to_shape(line.text_stripped) text=string.gsub(text,"c","")
 
 - Comment: 0,0:00:00.00,0:00:00.00,1,,0,0,0,template line,{\p1\an7\pos(!x!,!y!)}!text!
 
  复制代码 写了个an7为基准的各个对齐方式pos转化,样式管理器里对齐方式边距都可以随便调整了,fsp暂时无解....... 
试验了下FONT_PRECISION是upscale倍率,默认情况是64倍放大然后再*downscale缩小为1/64,单独动这个参数在40字号以下都不理想(曲线凹凸有时候相反的,直线还好) 
索性去掉了text to shape 部分的downscale,直接在绘图代码那用\p7来缩小,效果拔群,就是体积比原来大了点。 
感觉这个lua还有很多能挖的功能。。。不过一个矢量化就困扰两天了orz 
shape下面一堆还没怎么研究 
顺便多了round取整简直好评 |   
 
  
 |