Is there a way to specify the font size as a float/double instead of integer. I am creating my font as:
Font font = new Font(shell.getDisplay(), "CormorantGaramond",14, SWT.NULL);
where 14 is the font size in points. But the constructor only accept an integer, which I find odd when the font size is specified in points and not pixel. Is there a way to specify font size as a non integer value. (It is a ttf font, if that matter).
It seems that currently (Eclipse Platform
Mars 4.5) there is no platform-independent way to set the font height using the value of the float
type.
Reference: org.eclipse.swt.graphics.FontData (Eclipse Platform API Specification) - Help - Eclipse Platform.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With