[JW Lua] More Page Text Fun

Charles O. Lawrence charlesolawrence at bellsouth.net
Wed Oct 23 18:25:17 CEST 2013


Dave et al,

You are right about bit 6 meaning fixed size in the ^nfx() tag.  That leaves
bits 3 and 4 still unknown.  I can confirm that the escape sequence of \r
will put in a line break, but you will probably need to adjust the line
spacing to get something that looks pleasing.

Charles




-----Original Message-----
From: JWLua [mailto:jwlua-bounces at jwmusic.nu] On Behalf Of Dave Foster
Sent: Wednesday, October 23, 2013 9:18 AM
To: jwlua at jwmusic.nu
Subject: Re: [JW Lua] More Page Text Fun

Hi Jari and all,

Thanks for figuring this out - I can confirm that I'm happily creating text
programatically and putting it all over the page! A couple of things I've
found / wondered:

1)	The mysterious Enigma tag ^nfx can be set to ^nfx(64) for Fixed Size
(font size)

2)	Following on from Charles' questions, is there a way to get a line
break when setting the text? /n isn't working here. Eg:

local newText = finale.FCPageText()
local textObject = finale.FCString()
textObject:AppendLuaString("First Line\nSecond Line")
newText:SaveNewTextBlock(textObject)
newText:SaveNew(1)

understands the escape character (just showing "First LineSecond Line") but
doesn't act on it.

3)	Is there any way to get / set the wildcards eg Title, Subtitle etc
from Window / Score Manager / File Info (formally File / Score Info pre
2012)?

4) 	Using the numbers instead of the constants, I've found that the
enumerator in the docs for TEXT_VERTICAL_ALIGN is slightly off - it should
be

TEXTVERTALIGN_TOP (= 0)
TEXTVERTALIGN_BOTTOM (= 1)
TEXTVERTALIGN_CENTER (= 2)

(not top, centre, bottom), which also makes it consistent with the
horizontal (left, right, centre).

I think your solution to circumvent the Finale quirk with Right Pages sounds
fine - as long as there is a way to check that the IndependentRightPage
hasn't been set other than checking for 0 (it may have be set to 0)?!

Thanks also for the tip about deleting all objects from a collection.

Cheers,

Dave

> I've tracked down the problem with the alignment. In your code, after 
> the line:
> 
>> newText.HorizontalAlignment = finale.TEXTHORIZALIGN_CENTER
> 
> add this line as well:
> newText.HorizontalAlignmentRightPage = finale.TEXTHORIZALIGN_CENTER
> 
> Then it should behave in the same way as Finale.
> 
> I'm not sure how to fix this in a good way. To me, this seems to be a 
> subtle Finale bug (that the right-side positioning is used even when 
> the check box isn't checked).
> 
> I guess I'm forced to clone the behaviour of Finale's Frame Attributes 
> dialog box: auto-copy the default positioning/alignment values to the 
> right-side positioning values if the IndependentRightPage hasn't been set.
> 
> In the meantime, use the temporary fix above.

_______________________________________________
JWLua mailing list
JWLua at jwmusic.nu
http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu





More information about the JWLua mailing list