Community
Participate
Working Groups
Using custom theme in eclipse which overwrites all fonts defined in JFaceResources has different effect on forms and formdialogs. Creating a form using FormToolkit the font used for form elements (FormText, Section…) is not changed (only title gets the overwritten font settings). Creating a similar form as a FormDialog, the overwritten font type for org.eclipse.jface.resource.JFaceResources.DIALOG_FONT is applied to most elements in the formdialog (except Section Header and ExpandableComposite title). Is there a way to get the UI-Elements in _normal_ forms working with JFaceResources fonts (like formheader text does already)?
Fonts are not applied to Eclipse parts automatically. If you look at all the dialog implementation, you will see a line 'applyDialogFonts' or similar that uses JFaceResources to apply fonts to the dialog and override SWT defaults. You need to do the same in forms (except forms pick up JFaceResources header font for the title).
(In reply to comment #1) FormDialog extends Dialog and uses _applyDialogFont_ from Dialog class where dialog font type from JFaceResources ist set to every composite child within the dialog. But Section and Expandable Header fonts are still SWT defaults. IMHO the different behaviour of Forms and FormDialog is confusing. A solution could be implementing an _applyDialogFont_ method in Form and ScrolledForm class.
Created attachment 85550 [details] Dialog font support Patched FormToolkit class for support of the dialog font from JFaceResources
applyDialogFont comes from org.eclipse.jface.dialogs.Dialog, not from FormDialog. It does not make sense to have a method like this on Form or ScrolledForm as they are not dialogs and should not be using a dialog font. We cannot change the default behaviour of the toolkit as it would change every clients default fonts and would likely break many existing layouts. It should be very simple for you to make a set of methods to call toolkit.createBlah and then apply a JFace font and return the result. This cannot be addressed at the forms level. Closing as WONTFIX.