A major OS update might introduce new default fonts, and what was once a nice looking application will look like an alien. With the above code that creates a BOLD font, you also specified the font name and size. The problem here is that you might not know which fonts are used on the system that will run your application.
A Label is created with the default font “Arial”, the default size “12” and our desired style “BOLD”. So what’s the problem with this snippet? setText ( 'Bold Label' ) Įverything seems to be fine with this code. getDisplay (), new FontData ( 'Arial', 12, SWT.