Raymond DeCampo said:
Windows APIs have had this mechanism for a long time. The
units are referred to as dialog units. The application deals
with dialog units and the graphics environments deals with the
translation to physical units (be they pixels on a screen or
dots on a printed page).
Possibly information one can obtain from the current
look-and-feel (from UIDefaults and UIManager) might help?
I assume that the current look-and-feel must know which font
size the user can comfortably read, so I might use this
information (about a "default" font of the current
look-and-feel). For example, the width of an "M" in that font
might become my "em" unit, the height of an "x" in that font
might become my "ex" unit and everything else might be given
in these units.
I do not really understand the meaning the argument in
UIManager#getFont(Object), I would like to use something
like "getFont(null)" to get a reasonable default font in
a reasonable size for readable text, indepently of the
specific look-and-feel used. I found code like:
font = UIManager.getFont("Button.font");
And I found this:
When colors or fonts are needed, the correct technique is
to use the methods getColor(Object key) and getFont(Object
key) of the class javax.swing.UIManager. These methods
take a key that identifies a color or a font as a
parameter, and they return the corresponding color or font
as it is defined by the current PLAF. Unfortunately, the
list of the available keys is not documented. However, the
keys are included in the source code of the class
javax.swing.plaf.basic.BasicLookAndFeel.
http://www.research.ibm.com/journal/sj/424/willuhn.html