Keeping first/last line position in multi-line text set via OSC

165 views
Skip to first unread message

Freddy Komp

unread,
Sep 11, 2016, 8:29:40 PM9/11/16
to QLab
Hi all,


Is there currently in existence/can there be a way to

- Set a titles text via OSC to a new value (and because of defined width of the titles cue, causing more or less lines in the process)
- keep the first line in its current position (as opposed to centering the text around the anchor point)

?

This would be very helpful, as it is often a desirable and expected behaviour in similar situations (most design programs, i.e. Adobe Illustrator work this way). Another option would be to offer 3 different alignment settings (like Microsoft Excel), where a cell's text can be aligned to the bottom, to the top, or (as it seems to be the case with QLab at the moment) vertically centered.


Cheers,

Freddy

Freddy Komp

unread,
Oct 27, 2016, 9:35:31 AM10/27/16
to QLab
Hi there,


May I assume from the lack of response that there is no way to do so at the moment? And if so, is this on a short term list to implement, i.e. in V4?


Cheers,

Freddy

Chris Ashworth

unread,
Oct 27, 2016, 9:39:37 AM10/27/16
to ql...@googlegroups.com
Hi Freddy,

Speaking only for myself, for the kinds of questions you ask I often don’t respond because I don’t honestly know if there is a way to do it or not. I’ve often been surprised by solutions people on the list come up with, so unless I know for sure that it’s impossible (or know how to do it myself) I don’t say one way or the other.

But, in this case, I don’t know a way to do what you’re asking. 

Best,
C

Rich Walsh

unread,
Oct 27, 2016, 9:46:35 AM10/27/16
to ql...@googlegroups.com
You could pad all your text so that it always has the same number of lines. alt-return appears to allow you to enter line breaks into the string. although I don’t know if that’s within the OSC spec…

Rich

Rasmus Kreiner

unread,
Oct 27, 2016, 9:53:20 AM10/27/16
to ql...@googlegroups.com
For what its worth this approach has proven fairly succesfull in a show I’ve done just recently.

One thing to keep in mind is that sending an empty string - eg. “” - will reset the justification of the titles cue back to centered.


-- 
-- 
Change your preferences or unsubscribe here: 
http://groups.google.com/group/qlab
 
Follow Figure 53 on Twitter: http://twitter.com/Figure53
--- 
You received this message because you are subscribed to the Google Groups "QLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qlab+uns...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qlab/E485BB58-438C-4502-A501-E97A54F9A75D%40mac.com.
For more options, visit https://groups.google.com/d/optout.

Freddy Komp

unread,
Oct 27, 2016, 10:11:51 AM10/27/16
to QLab
Thanks all for the comments,

- Rich, while that is an interesting approach, it is hard/laborious to predict how many lines any given text needs with variable spaced fonts, as there is no formula to automate this with, which brings us back to manual handling and manual line breaks with trial and error (and I guess in that case, the whole point of OSC/scripting becomes a bit moot, or am I overlooking something?)

- Rasmus, how did you deal with this?


Thanks again,


Freddy

Rasmus Kreiner

unread,
Oct 27, 2016, 10:13:18 AM10/27/16
to ql...@googlegroups.com
Sending a single white space (“ “) will keep the justification.


Freddy Komp

unread,
Oct 27, 2016, 10:21:44 AM10/27/16
to QLab
Thanks Rasmus,

That does keep the horizontal justification, but it still stays vertically centred, i.e. adding or taking away lines will move the vertical position of the first line.

Rich Walsh

unread,
Oct 27, 2016, 7:38:11 PM10/27/16
to ql...@googlegroups.com
It depends how much effort you want to make to save some effort. It would be dull but simple to create a lookup table of the widths of the characters in your font: http://bluejamesbond.github.io/CharacterMap/. Then calculate the width of a string and pad accordingly. Although, if you know the number of lines you’ll be able to calculate the height and translate the Titles Cue to compensate anyway…

Rich

micpool

unread,
Sep 2, 2021, 7:41:13 AM9/2/21
to QLab
Reviving this very old thread as I needed to do this, and found a way (perhaps this has been solved previously, but I couldn't find it in a search of the group)

It uses an OSC cue which uses an OSC query to get the height of each text cue and stores this in it's notes field for this script to process:

set theSurfaceHeights to 400 --Height in Pixels of title output surface

tell application id "com.figure53.QLab.4" to tell front workspace
set theCues to cues of front cue list whose q type is "text"
repeat with eachcue in theCues
set the text alignment of eachcue to "left"
--calculate Y position
set the custom message of cue "TEMPEN" to "/cue/TEMPEN/notes \"#/cue_id/" & (uniqueID of eachcue) & "/text/outputSize#\""
start cue "TEMPEN"
set theTextHeight to paragraph 3 of (notes of cue "TEMPEN" as string)
set the translation y of eachcue to theSurfaceHeights / 2 - theTextHeight / 2
end repeat
end tell

You can easily adapt the maths to align to the bottom of the surface if required.

Workspace and screen recording attached.



Align Top of MultilineTexts.mov
Align Multiline Text Cues.qlab4.zip
Reply all
Reply to author
Forward
0 new messages