Project

General

Profile

Bug #6562

Fix displaying of fonts applied to widgets through LOAD+USE or by changing the parent window

Added by Stanislav Lomany almost 2 years ago. Updated almost 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
06/27/2022
Due date:
% Done:

0%

billable:
No
vendor_id:
GCD
case_num:
version:

two windows.png (15.9 KB) Stanislav Lomany, 06/27/2022 06:19 PM

three windows.png (19.1 KB) Stanislav Lomany, 06/27/2022 06:19 PM

test.ini Magnifier (3.53 KB) Stanislav Lomany, 06/27/2022 06:23 PM

test2.ini Magnifier (3.54 KB) Stanislav Lomany, 06/27/2022 06:23 PM

font-three.p Magnifier (1.1 KB) Stanislav Lomany, 06/27/2022 06:25 PM

font-all-widgets.p Magnifier (3.16 KB) Stanislav Lomany, 06/27/2022 06:25 PM

fonts-changes.diff Magnifier (1.12 KB) Stanislav Lomany, 06/27/2022 06:38 PM

History

#2 Updated by Stanislav Lomany almost 2 years ago

There are three ways how fonts may be applied/changed:
  1. An .ini file can be loaded at startup by specifying the ininame parameter. Loaded configuration effectively replaces the default font table and the default font which defines the size of widgets. This part was implemented for FWD in #4508.
  2. An .ini file can be loaded with LOAD and following USE. The new fonts are in effect for windows created after USE call. In this case default font is not changed and therefore the size of elements in most cases stays untouched. Each type of widgets react to fonts differently. By "react" I mean that widget may change its size or not and the new font may be applied or not. Also, widget may be initialized before the parent window is set, e.g. in frame.openScope so we should explicitly update the widget state.
  3. When a frame changes its parent window, a new font table is applied to the frame. In this case effect is even more limited than in the previous case.

I've attached testcases to demonstrate the issue. Also the screens are attached. To get the same output as on the screens, create deploy/client/test.ini configuration file with font6 of size=12 and deploy/client/test2.ini with font6 of size=20, bold. Sample ini files are attached.

As a part of solution, I suggest to add void notifyWindowChanged(boolean initialPlacement) function to Widget interface. initialPlacement parameter is true if window is set for a frame for the first time rather than the frame changes the parent window. A diff which implements call of this function is attached.

#3 Updated by Greg Shah almost 2 years ago

Is this describing the way it is supposed to work in the 4GL?

#4 Updated by Stanislav Lomany almost 2 years ago

Is this describing the way it is supposed to work in the 4GL?

Yes.

#5 Updated by Stanislav Lomany almost 2 years ago

The difficulties here:
  1. The changes should be performed for each widget type individually.
  2. Existing ways of widget initializations should be changed so font could be changed later.
  3. Widget size may be defined by one font while the other font is used for drawing.
  4. Text clipping and positioning issues.

Also available in: Atom PDF