[JW Lua] Expression Categories

Jari Williamsson jari.williamsson at mailbox.swipnet.se
Fri Oct 25 17:49:57 CEST 2013


Yes, this seems to be correct. I believe the same things apply to 
positioning, but FCTextExpressionDef::AssignToCategory() would set the 
positioning for the expression. Perhaps I should add a method that 
changes the raw text string of the FCtextExpressionDef according to the 
category as well.


Best regards,

Jari Williamsson


On 2013-10-25 12:40, Dave Foster wrote:
> Hi Jari,
>
> Thanks for this, to check we're understanding each other - so for expressions which belong to the "Tempo Marks" category, that already have "Use Tempo Marks Category Fonts" selected, changing the font in the category (programatically) doesn't update the expression fonts? They update when I change it manually - if I run:
>
> -- Get the ID for the Tempo Marks category
> local expCats = finale.FCCategoryDefs()
> expCats:LoadAll()
> local tempoMarkID
> for expCat in each(expCats) do
> 	local title = expCat:CreateName()
> 	if (title:StartsWith("Tempo Marks")) then
> 		tempoMarkID = expCat:GetID()
> 		--local fontInfo = finale:FCFontInfo() -- (1)
> 		--fontInfo.Name = "Arial Black" -- (2)
> 		--expCat:SetTextFontInfo(fontInfo) -- (3)
> 		--print(expCat:Save()) -- (4)
> 	end
> end
> -- Print the full strings of expressions in the Tempo Marks category
> local exps = finale.FCTextExpressionDefs()
> exps:LoadAll()
> for exp in each(exps) do
> 	if (exp:GetCategoryID() == tempoMarkID) then
> 		local expText = exp:CreateTextString()
> 		print (expText.LuaString)
> 	end
> end
>
> then manually go in and change the Tempo Marks category fonts, then run it again, the Enigma font strings have changed. However, un-commenting lines (1)-(4) in the code (to change the category font programatically) the category fonts update and in the expression designer, but not the fonts in the expressions themselves. Is this right?
>
> Cheers,
>
> Dave
>
>
>
>> Dave, Category font settings in the expression definitions needs to be
>> changed manually in the raw Enigma strings, if the expression
>> definition belongs to the category. Look for the ^fontMus() and
>> related commands. Do not change ^font() commands. Best regards, Jari
>> Williamsson On 2013-10-24 15:28, Dave Foster wrote: >/Messing around
>> today with expression categories - having a lot of success with
>> setting default fonts etc. I'm struggling, though, once I've set the
>> default fonts for a category, to get expressions where "Use … Category
>> Fonts" is selected to update to the new fonts. It appears to have set
>> it when looking at the definition but the text itself hasn't updated.
>> Might this be a case where something needs to be updated internally,
>> or is there some save or update method that I've missed? Here's some
>> example code - try it on a default score where the Tempo Marks have
>> been set to "Use Tempo Marks Category Fonts":/
>
>
>
>
> _______________________________________________
> JWLua mailing list
> JWLua at jwmusic.nu
> http://jwmusic.nu/mailman/listinfo/jwlua_jwmusic.nu
>






More information about the JWLua mailing list