Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JavaFX 2.2 font rendering problematic

We can't satisfactorily get the Roboto Thin font displaying in our JavaFX app at the size we want. It suffers from aliasing in the rending.

We took the Roboto font from here. (actually from maven)

It looks fine at 100px which is too large for our purposes. 100pxImage

Ideally we want this to be re-sizable and stretchable. However, it looks jagged even at 50px which should be the most accommodated since its divisible by 2 (no fallover pixels from the perfect looking 100). We've tried other small sizes with equal dissatisfaction.

50pxImage

If you look at this link of RobotoThin100 rendered as a Google web font, it is much smaller and doesn't have any of these aliasing issues.

We are planning on using this porting framework to run on android which means we need to use Java 7 and can't upgrade to JavaFX 8 as we currently understand it. However, the screenshots are simply from the Windows 7 version at the moment.

Our CSS looks like the following:

.label
  {
    -fx-text-fill:#ffffff;/*white*/
    -fx-font-size: 100px;
    -fx-font-family: "Roboto Thin";
  }

Are we doing something wrong?

Thanks in advance.

like image 550
jsg Avatar asked Dec 06 '13 10:12

jsg


1 Answers

so @Aliana you mean you want your text to be re-sizable on its on throughout the devices, if so insted of 100px you must place 100dp(digital pixels) and not pixels

like image 121
We're All Mad Here Avatar answered Sep 20 '22 13:09

We're All Mad Here