Vertical Text alignment to Baseline of text

72 views
Skip to first unread message

FL K

unread,
Jul 26, 2024, 5:37:40 PMJul 26
to QLab
Hi lovely folks at Figure 53,

I've used Glypheo for a while to do subtitles (and trigger them via QLab), but for a project I am doing now I wanted to use QLab, for its scriptability etc; However, revisiting this area after a long while, I noticed an issue that is yet unresolved - the vertical text alignment to the baseline of a text.

To avoid ambiguity, I am talking about the typographical baseline, as defined here:


I remembered that because of image units etc, everything that QLab puts out is centre aligned to the actual output of a video cue, and so that two text cues with the same position, but one being a single line and the other one two lines, will not align because of that.not great, but probably something I could deal with programmatically, IF text cues DID align to their baseline.

I did not think it would bite me this time since I am only using single lines of text, BUT - I have discovered that it really relies on the font and text, example:
a lower case A would align different vertically to a lower case G or an uppercase A - because QLab only treats it as an image, and so the generated image bounds determine the height and then it uses the centre point of that for centre...

I feel the train is out of the station for this project, because there is only a few days before we tech (so I might have to resort back to Glypheo, with its own limitations, or adjust every single subtitle manually vertically), but still, for the future...

Feature request: Please make vertical text alignment based on the baseline of a font make sense to people who work with text frequently (word processors seem to implement the concept of aligning via the baseline of a text, rather than its geometrical centre)...

So beyond asking to please add this to the tracker if deemed worthy, I'd also love to hear if this is at all something that feels doable in the near future?

And from the community, does anyone have a work-around for this issue? I mean, I could probably try and script something that text output size and then makes assumptions based on that (to at least catch multi-line text), but I'd still not know whether "extra" height is added to the bottom or to the top based on the envelope being stretched by particular glyphs.

Here's to hoping there is some sort of solution out there...

Looking forward to hear everyone's thoughts :)!

Cheers,

Freddy

Rich Walsh

unread,
Jul 26, 2024, 5:54:14 PMJul 26
to ql...@googlegroups.com
Would it work to put a hidden character (say §) on every line to force them to the same height – one at each end, the same colour as the background?

Rich

micpool

unread,
Jul 26, 2024, 6:16:47 PMJul 26
to QLab
The simplest solution is to use QLab 4!

For readers that haven't quite grasped what is being discussed.

Here's a QLab 5 text cue with text with no ascenders or descenders sitting on top of a separate graphic of a line

Screenshot 2024-07-26 at 23.08.05.png

Here is  text with ascenders

Screenshot 2024-07-26 at 23.08.35.png

So far so good!
 
and now we add a character with a descender

Screenshot 2024-07-26 at 23.08.49.png

and the text base line shifts

In QLab 4, it doesn't.

Mic

micpool

unread,
Jul 26, 2024, 7:17:52 PMJul 26
to QLab
On Friday, July 26, 2024 at 10:54:14 PM UTC+1 Rich Walsh wrote:
Would it work to put a hidden character (say §) on every line to force them to the same height – one at each end, the same colour as the background?

That's a good idea. You can set it up in the Text Cue template § Text § and then set the colour of the symbols to the background color. and the word Text to the foreground

When you create a new text cue, just double-click the word text and type the new text.

Mic

micpool

unread,
Jul 27, 2024, 5:22:56 AMJul 27
to QLab
If you want to set the text of cues from Applescript and add the invisible baseline placeholders, set your Text Template as in my previous post:

 § Text § and then set the colour of the symbols to the background color. and the word Text to the foreground color

Then use this script, adding  whatever script you need  to read your text source

set theString to "Molly is Lolly" -- script to read text source goes here
tell application id "com.figure53.QLab.5" to tell front workspace
make type "text"
set theCue to last item of (selected as list)
set AppleScript's text item delimiters to "Text"
set theText to the text of theCue
set theText to text item 1 of theText & theString & text item 2 of theText
set the text of theCue to theText
set theCount to (count of characters of theText) - 4
set theForeground to {rgbaColor:{red:1, green:1, blue:1, alpha:1}, range:{rangeOffset:3, rangeLength:theCount}}
set the text format of theCue to theForeground
end tell

Mic

Chris Ashworth

unread,
Jul 27, 2024, 7:22:53 AMJul 27
to FL K, ql...@googlegroups.com
Hi Freddy,

Yes, we’re tracking this and are interested in resolving it.  My teammate Brent has done some work on it, although some complications have arisen, but it’s on our radar for sure.

-C

FL K

unread,
Jul 27, 2024, 11:08:34 AMJul 27
to QLab
Thanks Mic and Rich for the excellent pointers, and Chris and Brent for the hope on the horizon :)!

I'll see if the script work-around or running a QLab 4 instance alongside it works better for me in this specific instance, but both are really helpful towards my deadline :)...

All the best from Edinburgh,

Freddy

Reply all
Reply to author
Forward
0 new messages