Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: 支持导入样式 #4

Open
CberYellowstone opened this issue Jul 10, 2023 · 3 comments
Open

Feature Request: 支持导入样式 #4

CberYellowstone opened this issue Jul 10, 2023 · 3 comments

Comments

@CberYellowstone
Copy link
Member

如题

@CberYellowstone
Copy link
Member Author

@Echoosx

@Echoosx
Copy link

Echoosx commented Jul 10, 2023

思路

  • 前端:在GUI上增加两个文件选择组件:label分别是flag默认样式混血默认样式,限定选取ass样式(如果可以尽量做成顶栏切换的窗口,或者做成可以展开的高级选项,平时隐藏起来)
  • 导入逻辑:用户使用上述的flag默认样式组件选择本地的ass文件,提取样式内容后,将样式内容作为配置文件缓存下来,输出字幕文件时直接使用配置文件中的样式即可。
  • 提取样式信息:选取ass文件后,将文件中的样式以文本提取出来,这里是一个ass示例,
    [V4+ Styles]标签到[Events]标签之间的部分是完整的样式信息
    [Script Info]
    ; Script generated by Aegisub 3.3.2
    ; http://www.aegisub.org/
    Title: Default Aegisub file
    ScriptType: v4.00+
    WrapStyle: 0
    ScaledBorderAndShadow: yes
    YCbCr Matrix: TV.709
    PlayResX: 1920
    PlayResY: 1080
    
    [Aegisub Project Garbage]
    Last Style Storage: 全力回避flag酱
    Audio File: demo.mp4
    Video File: demo.mp4
    Video AR Value: 1.777778
    
    [V4+ Styles]
    Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
    Style: Default,思源黑體,100,&H00FFFFFF,&H00FFFFFF,&H00000000,&H910E0807,-1,0,0,0,100,100,1.14695,0,1,7,4,2,135,135,50,1
    Style: 未定义#1,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00000000,&H910E0807,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
    Style: 路人男#1,极影毁片圆 Medium,95,&H00FCA439,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
    Style: 死亡flag#1,极影毁片圆 Medium,95,&H0042FFF8,&H00FFFFFF,&H00000000,&H17FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
    Style: 生存flag#1,极影毁片圆 Medium,95,&H00BAFF48,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
    Style: 恋爱flag#1,极影毁片圆 Medium,95,&H00F4A9FF,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
    Style: 失恋flag#1,极影毁片圆 Medium,95,&H00FFED7D,&H00FFFFFF,&H00000000,&H17FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
    Style: 路人美#1,极影毁片圆 Medium,95,&H0091E1FB,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
    Style: 死神No.13#1,极影毁片圆 
    
    [Events]
    Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
    Dialogue: 1,0:00:02.62,0:00:03.58,开场白,Opening,0,0,0,,立起来了!
    Dialogue: 1,0:00:04.90,0:00:07.69,开场白,Opening,0,0,0,,全力回避flag酱!
    ...
    

@Echoosx
Copy link

Echoosx commented Jul 10, 2023

预设的默认样式参考

flag

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: 未定义#1,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00000000,&H910E0807,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 路人男#1,极影毁片圆 Medium,95,&H00FCA439,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 死亡flag#1,极影毁片圆 Medium,95,&H0042FFF8,&H00FFFFFF,&H00000000,&H17FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 生存flag#1,极影毁片圆 Medium,95,&H00BAFF48,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 恋爱flag#1,极影毁片圆 Medium,95,&H00F4A9FF,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 失恋flag#1,极影毁片圆 Medium,95,&H00FFED7D,&H00FFFFFF,&H00000000,&H17FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 路人美#1,极影毁片圆 Medium,95,&H0091E1FB,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 死神No.13#1,极影毁片圆 Medium,95,&H0089FE97,&H00FFFFFF,&H00000000,&H17FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 贪婪#1,极影毁片圆 Medium,95,&H00D866AD,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 愤怒#1,极影毁片圆 Medium,95,&H005D54EE,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 嫉妒#1,极影毁片圆 Medium,95,&H00C07DF8,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 神#1,极影毁片圆 Medium,95,&H00D2FEFF,&H00FFFFFF,&H00000000,&H17FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 洋红色【魅力美#1,极影毁片圆 Medium,95,&H00A643F6,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 东云色【辣妹美#1,极影毁片圆 Medium,95,&H009196F8,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 淡紫色#1,极影毁片圆 Medium,95,&H00D97092,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 深红色#1,极影毁片圆 Medium,95,&H00251AF0,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 棕黄色#1,极影毁片圆 Medium,95,&H0039B0EB,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 玫瑰色#1,极影毁片圆 Medium,95,&H007848FE,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 蓝色#1,极影毁片圆 Medium,95,&H00F7797C,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 绿色#1,极影毁片圆 Medium,95,&H0090DB83,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 开场白,思源黑体 CN,120,&H00FFFFFF,&H00FFFFFF,&H00000000,&H910E0807,-1,0,0,0,100,100,1.14695,0,1,7,4,2,135,135,50,1
Style: 旁白#1,极影毁片辉宋 Bold,95,&H00FFFFFF,&H00FFFFFF,&H00000000,&H910E0807,0,0,0,0,102,100,1.14695,0,1,9,0,2,135,135,160,1
Style: 转场#1,仓耳渔阳体 W02,100,&H00FFFFFF,&H000000FF,&H00000000,&H00000000,-1,0,0,0,100,100,0,0,1,8,0,2,10,10,350,1
Style: 译注,思源黑体 CN,80,&H00FFFFFF,&H00FFFFFF,&H00000000,&H910E0807,-1,0,0,0,100,100,1.14695,0,1,5,2,7,50,0,50,1
Style: 路人男#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 死亡flag#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 生存flag#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 恋爱flag#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 路人美#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 神#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 洋红色【魅力美#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 东云色【辣妹美#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 淡紫色#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 旁白#2,极影毁片辉宋 Bold,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H290E0807,0,0,0,0,102,100,1.14695,0,1,13,4,2,135,135,160,1
Style: 转场#2,仓耳渔阳体 W02,100,&H00FFFFFF,&H000000FF,&H00FFFFFF,&H00000000,-1,0,0,0,100,100,0,0,1,12,4,2,10,10,350,1
Style: 未定义#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 失恋flag#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 死神No.13#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 深红色#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 棕黄色#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 贪婪#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 愤怒#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 嫉妒#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 玫瑰色#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 蓝色#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 绿色#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 路人妹#1,极影毁片圆 Medium,95,&H00BF7DF7,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 路人妹#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 死神No.1#1,极影毁片圆 Medium,95,&H008428CA,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 死神No.1#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 娜娜#1,极影毁片圆 Medium,95,&H004F83FA,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 娜娜#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1
Style: 毁灭flag#1,极影毁片圆 Medium,95,&H00BDC805,&H00FFFFFF,&H00000000,&H13FFFFFF,-1,0,0,0,100,100,1.14695,0,1,7,0,2,135,135,160,1
Style: 毁灭flag#2,极影毁片圆 Medium,95,&H00FFFFFF,&H00FFFFFF,&H00FFFFFF,&H17000000,-1,0,0,0,100,100,1.14695,0,1,11,4,2,135,135,160,1

混血

[V4+ Styles]
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
Style: 千夜,思源黑体 CN Heavy,85,&H003231FD,&H00FFFFFF,&H000F2434,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 冰雨,思源黑体 CN Heavy,85,&H00F9FD97,&H00FFFFFF,&H00613616,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 希迪,思源黑体 CN Heavy,85,&H0038FDFF,&H00FFFFFF,&H00022F4B,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 约梅,思源黑体 CN Heavy,85,&H000497FD,&H00FFFFFF,&H00092436,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 波提斯,思源黑体 CN Heavy,85,&H00CE97C2,&H00FFFFFF,&H00470033,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 米提,思源黑体 CN Heavy,85,&H00F98FF4,&H00FFFFFF,&H000D2F51,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 洛伊克,思源黑体 CN Heavy,85,&H00A5E8FA,&H00FFFFFF,&H0009353F,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 店长,思源黑体 CN Heavy,85,&H007B80C5,&H00FFFFFF,&H00183642,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 开场白,思源黑体 CN Heavy,100,&H00FFFFFF,&H00FFFFFF,&H00000000,&H8C0E0807,-1,0,0,0,100,100,1,0,1,0,5,2,135,135,20,1
Style: 译注,思源黑体 CN Heavy,80,&H00FFFFFF,&H00FFFFFF,&H00000000,&H910E0807,-1,0,0,0,100,100,1,0,1,5,2,7,50,0,50,1
Style: 蓝色,思源黑体 CN Heavy,85,&H00F8968D,&H00FFFFFF,&H002E0303,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 紫色,思源黑体 CN Heavy,85,&H00FF74C3,&H00FFFFFF,&H004E013A,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 褐色,思源黑体 CN Heavy,85,&H007677B7,&H00FFFFFF,&H0006063F,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 白色-棕边框,思源黑体 CN Heavy,85,&H00FFFFFF,&H00FFFFFF,&H00133045,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 白色-黑边框,思源黑体 CN Heavy,85,&H00FFFFFF,&H00FFFFFF,&H0006063F,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 肉色,思源黑体 CN Heavy,85,&H00A1A2F7,&H00FFFFFF,&H00121332,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 土黄色,思源黑体 CN Heavy,85,&H007AB9F6,&H00FFFFFF,&H001B2F46,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 淡绿色,思源黑体 CN Heavy,85,&H00C4FFB3,&H00FFFFFF,&H001D311D,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 墨绿色,思源黑体 CN Heavy,85,&H00819D5A,&H00FFFFFF,&H00353F0E,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1
Style: 荧光绿,思源黑体 CN Heavy,85,&H0007FF64,&H00FFFFFF,&H00023D10,&HA0000000,-1,0,0,0,100,100,0,0,1,6.5,3,2,10,10,115,1
Style: 橘红色,思源黑体 CN Heavy,85,&H00054FF0,&H00FFFFFF,&H00051536,&HA0000000,-1,0,0,0,105,100,0,0,1,6.5,3,2,10,10,115,1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants