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

rotate option of pango producer seems not working #1015

Open
myme5261314 opened this issue Aug 21, 2024 · 2 comments
Open

rotate option of pango producer seems not working #1015

myme5261314 opened this issue Aug 21, 2024 · 2 comments

Comments

@myme5261314
Copy link

This tracker is for defects only! For feature requests, you can submit a pull
request with the changes.

If you’re reporting a defect, make it as detailed as possible, and include both your operating system and MLT versions (e.g. macOS 10.16; MLT v7.4.0).

OSX 13.6.9 MLT v7.24.0

following shell will produce non-rotated text rendering in the video.

melt color:red out=250 -track -producer pango rotate=-90 text="Hello.你好" out=250 -transition composite -consumer avformat:pango.mp4
pango.mp4

Please take a look at some examples of pango text.

pango-view --text "Hello" --rotate -90  -o pango.png

pango

pango-view --text "你好" --rotate -90 --gravity=east  -o pango.png

gravity sets to auto will have same visualization.
pango

I notice two things:

  • gravity property in pango markup text have no effects.
pango-view --markup --text "<span gravity='east'>你好</span>" --rotate -90  -o pango.png

pango

What I want to implement is the Microsoft Office's vertical text in the bounding box. Visualization like below.
image

But with the pango markup shell, it seems there is no way to adjust gravity only for Chinese characters (the gravity property in the span tag makes no effects).

pango-view --markup --text "<span>Hello,</span><span gravity='east'>你好</span>" --rotate -90  -o pango.png

pango

With melt shell, it seems there is no way to implement vertical text from pango producer since the rotate parameter makes no effects in the first described video.

@bmatherly
Copy link
Member

following shell will produce non-rotated text rendering in the video.

Rotated text is not supported when the pixel aspect ratio is not 1.0.

You can work around this by specifying a profile with square pixels.

For example, try this:
melt -profile atsc_720p_30 color:red out=250 -track -producer pango rotate=-90 text="Hello2" out=250 -transition composite

Result:
image

Your comments about the gravity are true, but not a bug. Just not implemented. We would welcome a patch to improve it. Also, just so you know, the pango producer is pretty old and has fallen out of favor for the qtext producer. I don't think that producer will support your rotation needs either. But if you are thinking about submitting code improvements, you might want to focus on qtext instead of pango.

@myme5261314
Copy link
Author

Thanks for your help. It's good to know the rotate option of pango producer works with square pixel only.

I assume pango project still have some activities (https://gitlab.gnome.org/GNOME/pango/) and had already implemented the vertical text many years ago. (https://mces.blogspot.com/2007/05/advanced-opentype-features-in-pango.html)

Actually I can't find a proper way to implement vertical orientation text via qtext.
Even though qtext seems to support subset of html tags (https://doc.qt.io/qt-6/richtext-html-subset.html), but the most relevant feature lies in not included css property (https://developer.mozilla.org/en-US/docs/Web/CSS/text-orientation).

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