Repository navigation
Add rounded backgrounds to qtext - #1303
1996fanrui wants to merge 1 commit into
Conversation
|
Can you share some screenshots that show the property in action? Having the underscore in "bg_raduis" does not match the existing property name pattern which does not have an underscore. One of my regrets about the outline property is that it is specified in pixels. Specifying the size in pixels does not scale well when the user changes the project resolution or the font size. Do you have any ideas for how to do this differently for this property? Maybe percentage? Or maybe it is best to use pixel units since outline already does that. |
|
I am inclined to reject this because it a step on the slippery slope to bloat these filters. These are only supposed to be about text, and it can be argued that the background color is legacy baggage. I can already predict what's next: a background outline thickness and color, gradient fill. Then, everything that is In |
|
I am inclined to agree with your comments, Dan. On the other hand, there is a popular trend of animated subtitles on Facebook/Instagram (background highlighting and animated size). We do not currently have an easy way to generate that style. I wonder if this feature could lead to something like that (without all the slippery slope bloat you correctly mention). That is why I had asked for the screenshot/demonstration. |
|
We do not have a way to determine the timing of words in a phrase for much of that trend, but backgrounds for something that changes size frequently like subtitles is a valid use case. |
|
Thanks for the feedback. I tested the suggested approach with an unmodified MLT 7.22.0 build: generating one SVG per subtitle cue and compositing it using Based on that result, I agree that the background styling is better kept as a separate composited layer, so I will close this PR. Thanks for pointing me in the right direction. |
Add an animatable
bg_radiusproperty toqtext.A value of
0preserves the existing rectangular background. Positive values render rounded corners, clamped to half of the background rectangle's shortest side.The property is also exposed by text services that delegate to
qtext, includingsubtitle,dynamictext,timer,gpstext, and thesubtitleproducer.Tested with plain text, rich text, subtitle rendering, the full test suite, metadata validation, and clang-format checks.