make font/spacing configuration option
This commit is contained in:
parent
2a5d741ccf
commit
3f9280e0ba
1 changed files with 12 additions and 4 deletions
12
render.py
12
render.py
|
|
@ -953,16 +953,24 @@ YCbCr Matrix: None
|
|||
Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
|
||||
'''
|
||||
ass = header
|
||||
offset = 10
|
||||
offset = options.get("sub_margin", 10)
|
||||
spacing = options.get("sub_spacing", 20)
|
||||
height = 42
|
||||
styles = []
|
||||
for lang in reversed(langs):
|
||||
if isinstance(options.get("font"), list) and lang in options["font"]:
|
||||
font = options["font"][lang]
|
||||
else:
|
||||
font = 'SimHei' if lang in ('zh', 'jp') else 'Menlo'
|
||||
if isinstance(options.get("font_size"), list) and lang in options["font_size"]:
|
||||
size = options["font_size"][lang]
|
||||
else:
|
||||
size = 46 if font == 'SimHei' else 42
|
||||
|
||||
styles.append(
|
||||
f'Style: {lang},{font},{size},&Hffffff,&Hffffff,&H0,&H0,0,0,0,0,100,100,0,0,1,1,0,2,10,10,{offset},1'
|
||||
)
|
||||
offset += size + 20
|
||||
offset += size + spacing
|
||||
ass += '\n'.join(reversed(styles)) + '\n'
|
||||
events = [
|
||||
'Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue