[JW Lua] Expression Categories

Dave Foster fozder at me.com
Fri Oct 25 12:40:42 CEST 2013


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":


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20131025/cddaf52f/attachment.htm>


More information about the JWLua mailing list