MCPcopy Create free account
hub / github.com/Jack-Cherish/python-spider / WriteASSHead

Function WriteASSHead

bilibili/xml2ass.py:641–660  ·  view source on GitHub ↗
(f, width, height, fontface, fontsize, alpha, styleid)

Source from the content-addressed store, hash-verified

639
640
641def WriteASSHead(f, width, height, fontface, fontsize, alpha, styleid):
642 f.write(
643'''
644[Script Info]
645; Script generated by Danmaku2ASS
646; https://github.com/m13253/danmaku2ass
647Script Updated By: Danmaku2ASS (https://github.com/m13253/danmaku2ass)
648ScriptType: v4.00+
649WrapStyle: 2
650Collisions: Normal
651PlayResX: %(width)s
652PlayResY: %(height)s
653ScaledBorderAndShadow: yes
654[V4+ Styles]
655Format: Name, Fontname, Fontsize, PrimaryColour, SecondaryColour, OutlineColour, BackColour, Bold, Italic, Underline, StrikeOut, ScaleX, ScaleY, Spacing, Angle, BorderStyle, Outline, Shadow, Alignment, MarginL, MarginR, MarginV, Encoding
656Style: %(styleid)s, %(fontface)s, %(fontsize)s, &H%(alpha)02XFFFFFF, &H%(alpha)02XFFFFFF, &H%(alpha)02X000000, &H%(alpha)02X000000, 0, 0, 0, 0, 100, 100, 0.00, 0.00, 1, %(outline)s, 0, 7, 0, 0, 0, 0
657[Events]
658Format: Layer, Start, End, Style, Name, MarginL, MarginR, MarginV, Effect, Text
659''' % {'width': width, 'height': height, 'fontface': fontface, 'fontsize': round(fontsize), 'alpha': 255-round(alpha*255), 'outline': round(fontsize/25), 'styleid': styleid}
660 )
661
662
663def WriteComment(f, c, row, width, height, bottomReserved, fontsize, lifetime, styleid):

Callers 1

ProcessCommentsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected