Reputation: 159
I have a TextField and a Text object. Both use the exact same font,
but for the Text object there is a method that can be used to smooth the font: .setFontSmoothingType()
. However, no such method exists for TextField.
As Shaw pointed out, Text objects by default smooth the font, but this is not the case for TextFields.
This difference is unfortunately noticeable as seen in this screenshot:
The top is the TextField and the bottom is the Text with smoothing. So how would I smooth the font for the TextField?
Any help is appreciated, thanks!
Upvotes: 4
Views: 610
Reputation: 159
I was finally able to solve this problem! Using Scene Builder's CSS Analyzer, I was able to find a property called -fx-font-smoothing-type
under .text-field .text
. By changing the value to gray
, the text in the TextField will become smoothed!
Upvotes: 3