Kbase P50760: How is size of widgets calculated from DefaultFontSize ?
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  08/04/2010 |
|
Status: Unverified
GOAL:
How is size of widgets calculated from DefaultFontSize ?
GOAL:
What is the relation between widget size in pixels and widget size in characters in a GUI environment ?
FIX:
The relation between the size in pixels and the size in characters is dependent on the Pixels Per Unit (PPU) conversion factor.
Based on the datatype used in the widget this factor is determined by the settings for DefaultFixedFontSize (Integer, decimal and other datatypes that default to a fixed font) and DefaultFontSize (Character, logical and the other remaining datatypes).
The relation between height in characters and height in pixels is a linear relation, Height-pixels = Height-chars * PPU.
The same holds true for the width.
Note that the math involved is integer math (it's impossible to work with parts of pixels...) so rounding errors can and will occur when the PPU is determined, but these will usually not have a noticible impact on what will actually be displayed.