First of all, thank you for this, this project is amazing and the PGS subtitles look absolutely fantastic.
I’m trying to generate more PGS subtitles (because there aren’t any for the mono audio track, which has a few differences) and I’ve run into a stumbling block.
I’ve mostly got it working - I have the fonts installed, ImageMagick 7, Java, pango, Python, all that jazz. It is generating PNG files and they’re 90% correct, but there’s issues with the replaced characters (apostrophes, some full stops, etc - the ones the Python script replaces with reserved codepoints) which don’t seem to be working. Most obviously, apostrophes are sideways:
It’s some combination of the -gravity
setting and the custom glpyhs, I think, as the problem goes away if I either disable the character replacement or get rid of the gravity setting.
This is on Ubuntu Linux, by the way. I had no luck at all on MacOS so I figured that was a good OS to attempt it on.
I haven’t tried running the full script on Windows as I’m not sure how to override the exclusion patterns when running the .exe rather than the Python script. However, I did try rendering a single xml file generated by the script on Windows:
XML:
<span lang="en" font_desc="P3PO SW Matching" size="112773" weight="normal" foreground="white">
They shut down the main reactor
Well be destroyed for sure.
</span>
Command:
magick -gravity east pango:@test.txt test.png
And interestingly this gave a warning, which I didn’t get when doing the same thing on Linux:
** (process:5788): WARNING **: 20:28:18.397: couldn't load font "P3PO SW Matching Rotated-Left 110.1298828125", falling back to "Sans Rotated-Left 110.1298828125", expect ugly output.
** (process:5788): WARNING **: 20:28:18.402: couldn't load font "Sans Rotated-Left 110.1298828125", falling back to "Sans Rotated-Left 110.1298828125", expect ugly output.
** (process:5788): WARNING **: 20:28:18.406: All font fallbacks failed!!!!
** (process:5788): WARNING **: 20:28:18.408: All font fallbacks failed!!!!
I am wondering if this is related to the issue I’m having. It seems to be, as the warning goes away if I either remove the replacement glyphs, or get rid of the -gravity
option, so I think it might be a clue.
Anyway, I’m hoping this is an issue you’ve run into at some point and know what I’m doing wrong here.
Edit: I ran the script on Windows against the regular stereo mix subs just to test, and sure enough it’s spitting out those same warnings over and over, and it’s producing images like this:
So I believe it is the same issue and those warnings are probably related.