[JW Lua] FontName on accidentals returns "Times New Roman" - why?

Robert Wildling robertwildling at gmail.com
Tue May 31 09:16:03 CEST 2016


Playing around with FCAccidentalMod, I observed that the font returned is
not Maestro nor Engraver or anything else that is used in the score, but
"Times New Roman", which is not in use for accidentals. Also,
accMod:GetFontName() returns empry, GetFontInfo() and GetNameString both
retun the same string, "Times New Roman" - what is the difference between
those two?

This is the script:

function checkAccidentals(noteEntry, entryLayer)
    print(noteEntry:ClassName()) -- returns FCNoteEntry
    print(noteEntry.Count) -- returns 3

    for note in each (noteEntry) do
        print(note:CalcAccidental(), "|", note:CalcAccidental() )
        -- returns true (2x)
    end

   local accMod = finale.FCAccidentalMod()
   accMod:SetNoteEntry(noteEntry)

    for note in each (noteEntry) do
        if note.Accidental then
            accMod:SaveAt(note) -- do this first to make LoadFirst() work
            accMod:LoadFirst()

            local fontNameString = accMod:GetFontName()
            print("GetFontName:", fontNameString) -- returns empty
            print("GetFontName:", fontNameString.LuaString) -- returns nil
value

            local fontinfo = finale.FCFontInfo()
            accMod:GetFontInfo(fontinfo)
            print("GetFontInfo:", fontinfo:GetName()) -- returns Times New
Roman

            print("GetFontStyle:", accMod:GetFontStyle(fontinfo)) --
returns false ???

            local fontInfoString = finale:FCString()
            fontinfo:GetNameString(fontInfoString)
            print("Font Info String:", fontInfoString.LuaString)
            -- returns Times New Roman, too; why the same?

       end --// end if
    end --// end for each

end --// end checkAccidentals()


Any idea why this happens?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://jwmusic.nu/pipermail/jwlua_jwmusic.nu/attachments/20160531/15447785/attachment-0001.html>


More information about the JWLua mailing list