Could you please file a bug on this?

Best regards,
Alexander Kouznetsov
(408) 276-0387

On 23 дек 2013 15:31, Tom Schindl wrote:

The JavaDoc of Font.font says:

size - The point size of the font. This can be a fractional value, but
must not be negative. If the size is < 0 the default size will be used.

I highly doubt this is correct (see attached picture from Linux where
you see native, qt and javafx) and a sample FX-Code using setFont and
using CSS (see at the end of this mail)

The result is correct if CSS is used and looking up the code in the CSS
shows that values are calculated back to pixels when passed to the
Font-factory method (FontConverter.convert!).

I guess one can not fix this Font.font API to really work with points
(which would be the natural expectation at least to me) but the JavaDoc
has to be fixed!

Another thing I came across is that the DPI calculation is fixed to 96
DPI - which i don't fully understand why it is fixed because the DPI can
vary between devices and monitors. Is this because of multi-monitors and
you are applying a transformation based on the screen the text is
rendered on?


HBox h = new HBox();
                        Text t = new Text("Hello World");
                        Text t = new Text("Hello World");
                        t.setStyle("-fx-font-size: 50pt;");
                primaryStage.setScene(new Scene(h,300,300));

Reply via email to