Is there a way to get a list of all the fonts used in a Pan X file?
Here is some experimental code I came up with that inventories all the fonts used in all the forms of the current database.
let dbForms=dbinfo("forms","")
let blueprintCode=""
let fontList=""
looparray dbForms,cr(),element,item
formblueprint "",element,blueprintCode
blueprintCode=tagarray(blueprintCode,{"font","},{"},cr())
fontList=fontList+cr()+blueprintCode
endloop
arraydeduplicate arraystrip(fontList,cr()),fontList,cr()
displaydata fontList
I knew Gary would figure that out. He is a Panorama genius.
Thank you Gary! Very helpful.
I reformatted the code so that it lists the fonts used on each form rather than the composite of all fonts on all forms of the database.
let dbForms=dbinfo("forms","")
let blueprintCode=""
let fontList=""
looparray dbForms,cr(),element,item
formblueprint "",element,blueprintCode
blueprintCode="Form: "+quoted(element)+cr()+
arrayfilter(arraydeduplicate(tagarray(blueprintCode,
{"font","},{"},cr()),cr()),cr(),{" "+import()})
fontList=arraystrip(fontList+cr()+blueprintCode,cr())
endloop
displaydata fontList
This new code produced this output on my test database:
Form: "Main "
#SystemBoldFont
#SystemFont
Form: "Secondary"
#SystemBoldFont
#SystemFont
Form: "Form_B"
#SystemBoldFont
#SystemFont
Form: "Testing"
#SystemFont
Futura-CondensedMedium
Futura-Medium
Monaco
Form: "Image"
#SystemFont
Infinitely more useful! Since I have over 50 forms. Thank you so much Gary, you saved me lots of time as I prepare to deploy my first Pan X system.
One final revision that adds the font size to each font and adds a trap to prevent the procedure from executing when the Data Sheet is front-most (font info can not be gathered in this situation).
If info("windowtype")=2
message "Can not run when the Data Sheet is the active window!"
stop
endif
let dbForms=dbinfo("forms","")
let blueprintCode=""
let tempCode=""
let fontList=""
looparray dbForms,cr(),element,item
formblueprint "",element,blueprintCode
tempCode="Form: "+quoted(element)+cr()+
arrayfilter(arraydeduplicate(arraymerge(tagarray(blueprintCode,{"Font","},{"},cr()),
tagarray(blueprintCode,{"TextSize","},{"},cr()),cr(),", "),cr()),cr(),{" "+import()})
fontList=arraystrip(fontList+cr()+tempCode,cr())
endloop
displaydata fontList
This code produces this result in my experimental database:
Form: "Main "
#SystemBoldFont, 14 px
#SystemFont, 36 px
Form: "Secondary"
#SystemBoldFont, 12 px
#SystemFont, 36 px
Form: "Form_B"
#SystemBoldFont, 13 px
#SystemFont, 13 px
Form: "Testing"
#SystemFont, 13 px
Futura-CondensedMedium, 14 px
Futura-Medium, 14 px
Monaco, 13 px
Form: "Image"
#SystemFont, 13 px
Wonderful, thanks again for your help Gary!