Skip to main content

Problem:

Is it possible to change the default font used within a screenset at runtime?

Resolution:

There is no real way to globally alter the font within a screenset retrospectively.  We do provide the font side file functionality where font styles are associated with fonts.  These can be dynamically altered a run time.  However, you would need to go back and add the styles to each screenset.

One thing you could try (and this is still a manual process) is to export each screenset to an IMP file and edit this.

For example, most objects will be associated with the {Default-Font} style in the screenset.  In the export file below we have altered this to be "Times New Roman" and ensured each object picks up this style (StyleName).  You should find that most of your objects in the screensets have this by default i.e. the editing will be minimal.

Form TEST1

   Screenset Details

       First-Window WIN1

       Decimal-Char '.'

       Comma-Char ','

       Currency-Sign '$'

       Error-File "dserror.err"

       OLE-BASENAME "DSOLE"

       Style FLAG-88 ANSI GRID(1,1)

       Stylename {Default-Font}

   End Details

   Font-Record Stylename {Default-Font}

       Typeface "Times New Roman"

       Pointsize 14

       Attributes VECTOR PROPORTIONAL BOLD ITALIC

   End-Record

   Object WIN1

       Type WINDOW

       Parent DESKTOP

       Start (836,1252)

       Size  (1848,688)

       Display "Window Title"

       Style SIZE-BORDER TITLEBAR SYSTEM-MENU MINIMIZE MAXIMIZE CLIPPED

   End Object  #WIN1

   Object {NoName}

       Type TEXT

       Parent WIN1

       Start (104,304)

       Display "Famous Last Words..."

       Stylename {Default-Font}

   End Object  #{NoName}

   Object {NoName}

       Type TEXT

       Parent WIN1

       Start (108,484)

       Display "Some more text...."

       Stylename {Default-Font}

   End Object  #{NoName}

   Object EF1

       Type ENTRY-FIELD

       Parent WIN1

       Start (92,148)

       Size  (1312,64)

       Style RESIZE-CHAR('W') DISPLAY-FIELD

       Stylename {Default-Font}

       Picture x(60)

       Display "This is a display only entry field..."

   End Object  #EF1

   Global Dialog CASE(OFF)

       Event ESC

           RETC ;

       End Event # ESC

       Event CLOSED-WINDOW

           RETC ;

       End Event # CLOSED-WINDOW

   End Dialog

End Form

You then simply re-import the screenset file and save it to disk.  Make sure you take backups first -- just in case!

Old KB# 2904