Reading report font slots
Kelly Burgess
kellyb at montana.com
Tue Dec 15 03:06:27 EST 2020
Hi Scotte,
Try: Do $clib.$prefs.$reportfonts.$makelist($ref.$name,$clib.$prefs.$reportfonts.[$ref.$name].$fontname) Returns #L1
That gives me the Mac font names when I run it on Mac - I'd hope it would return the Windows font names when run on Windows.
Here's a snippet from TheRecipeManager (Studio 4.3.1) that prepared a report instance to use [pFontName] -- we designated an unused slot (7 in our case) to use for our variable font.
; set up the custom slot in the report font table for the user's preferred font
Calculate fontSlotNumber as 7 ;; unused reassignable slot in #MXRFONTS and #WIRFONTS
Calculate fontName as pFontName
Do $clib.$prefs.$reportfonts.[fontSlotNumber].$fontname.$assign(fontName)
;
That was followed by a loop through all the report objects to assign the font slot number etc.
Calculate thisLabel as objList.name
If objList.visible
Switch objList.type
Case 'label'
Do $cinst.$objs.[thisLabel].$textcolor.$assign(pColor)
Do $cinst.$objs.[thisLabel].$fontsize.$assign(labelSize)
Do $cinst.$objs.[thisLabel].$font.$assign(fontSlotNumber)
Case 'entry' ;; content fields ... (color stays black)
If thisLabel<>'REC_TITLE' ;; title managed above w/ bigger font
Do $cinst.$objs.[thisLabel].$fontsize.$assign(fontSize)
Do $cinst.$objs.[thisLabel].$font.$assign(fontSlotNumber)
If thisLabel='dfScaled' ;; scaledComment field content is displayed as a label
Do $cinst.$objs.[thisLabel].$textcolor.$assign(pColor)
End If
End If
Case 'component' ;; classifications and equipment lists not included in 4x6, ingredients and staging lists are data grid components
Do $cinst.$objs.[thisLabel].$rowfont.$assign(fontSlotNumber)
Do $cinst.$objs.[thisLabel].$rowfontsize.$assign(fontSize)
Do $cinst.$objs.[thisLabel].$headfontsize.$assign(labelSize)
Do $cinst.$objs.[thisLabel].$headtextcolor.$assign(pColor)
Default
; section, picture, rect, line
End Switch
End If
Hope that helps,
Kelly
More information about the omnisdev-en
mailing list