Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Want to use -fx-font-family preference list

bvmMar 21 2013 — edited Apr 26 2013
In regular CSS, the font-family attribute takes a list of family names, and uses the first one it finds that it knows about. Is there a way to accomplish the same thing in JavaFX? In particular, I hate the default monospace font, which is ugly and much fainter than other fonts of the same size. I'd like to be able to say
.foo {
    -fx-font-family: "Lucida Console", "Andale Mono", Monospace;
}
but that doesn't seem to be supported. Does anyone know of a good alternative? I could, of course, programmatically figure out which font is available, but that would seem to preclude the use of style sheets, since there isn't a way of doing dynamic substitution in .css resources, or is there?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 24 2013
Added on Mar 21 2013
7 comments
393 views