- Time
- Post link
So here's what I'm trying to do. I'm using a GUI utility (easySUP) which uses AviSynth's TextSub function (vsfilter.dll) to render text subtitles.
My problem is that all of the rendered subs are center-aligned. I would like the ability to include markup in my text subtitles which tells TextSub to render the subs left-aligned. Not left-aligned within the entire movie frame, just align all text so that they line up with the longest line of text along their left side. (This would be used for double-dialog, so the hyphens at the start would line up, for example--but the subtitles would still be toward the center-ish of the movie frame)
This change wouldn't be relevant for single lines of text, and I have no plans for more than two lines of text, so the logic would go something like this:
1) If there are two lines of text AND
2) Markup is detected at the beginning of both lines, THEN
3) Calculate the position of the longer line as normal, and
4) Calculate the position of the shorter line as normal, except the the leftmost X coordinate should match the X coordinate of the longer line.
The markup could be anything, even just a single non-frequently-used ASCII character like a pipe character, I don't care really. The markup would be stripped out before rendering naturally.
Any ideas how I should get started on this? I feel this is outside the range of my technical abilities, but I could probably make it with some hand-holding (or a generous spirit willing to write and compile it). I know some members of the community have compiled custom AviSynth DLLs before, so I'm hoping this is doable!