Reading report font slots
Scotte Meredith
spomacguy at gmail.com
Tue Dec 15 05:13:25 EST 2020
Thanks Kelly. That report fonts was what I was trying to find and I couldn’t find anywhere. I’ll use that.
Sent from my iPhone
> On Dec 14, 2020, at 7:06 PM, Kelly Burgess <kellyb at montana.com> wrote:
>
> 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
> _____________________________________________________________
> Manage your list subscriptions at http://lists.omnis-dev.com
> Start a new message -> mailto:omnisdev-en at lists.omnis-dev.com
More information about the omnisdev-en
mailing list