Synthetica Font Settings(12:08, 14. Feb. 2011)

In Synthetica each theme specifies a global font which is used by your application when the theme becomes activated. Most of our themes define 'Tahoma' as default font. However, Synthetica also allows you to specify a global font programmatically. The feature is helpful in case that you want to set a custom font i.e. to support non-Western platforms (see FAQ Font#4). In the example below the default font is set to 'Dialog 12'.

import de.javasoft.plaf.synthetica.SyntheticaLookAndFeel;
import de.javasoft.plaf.synthetica.SyntheticaStandardLookAndFeel;

try
{
  UIManager.setLookAndFeel(new SyntheticaStandardLookAndFeel());
  SyntheticaLookAndFeel.setFont("Dialog", 12);
}
catch (Exception e)
{
  e.printStackTrace();
}

For modifying the font size i.e. to increase readability, you don't have to touch the method above any longer. Since V2.12, Synthetica respects the system DPI settings on Windows and Linux/Gnome. This means the text for each component will be automatically scaled for being properly displayed on your system. In case that you want to control font scaling by yourself, you can disable this feature by setting the UI-property 'Synthetica.font.respectSystemDPI' to 'false' and set another UI-property called 'Synthetica.font.scaleFactor'. The property awaits a percentage value and has to be set before enabling the Look and Feel.

try
{
  //set font scaling to 125% 
  UIManager.put("Synthetica.font.scaleFactor", 125);
  //UIManager.put("Synthetica.font.respectSystemDPI", false);
  UIManager.setLookAndFeel(new SyntheticaStandardLookAndFeel());
}
catch (Exception e)
{
  e.printStackTrace();
}

The screenshots below demonstrate the settings 100, 125 and 150 together with SyntheticaClassyLookAndFeel.

100%

125%

150

In case that you have to specify different fonts in your app the Synthetica font feature has to be disabled by setting the UI-property 'Synthetica.font.enabled' to 'false' and by setting up the fonts within your synth.xml file. The UI-property 'Synthetica.font.disabled' is deprecated but still supported.

Related Links

How To Set A Custom Scalable Font Size
General UI-properties