Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Referring to fonts in Java on openSUSE 12.3
Referring to fonts in Java on openSUSE 12.3 [message #1125472] Fri, 04 October 2013 14:53 Go to next message
Colin Beckingham is currently offline Colin BeckinghamFriend
Messages: 2
Registered: October 2013
Junior Member
I'm using Eclipse Kepler openSUSE 12.3 64 bit under Gnome and having an issue with fonts.
In a programme, a line

theTitleLabel.setFont(new Font("sansserif",Font.BOLD, 36));


works correctly, but the more indirect reference

theTitleLabel.setFont(new Font(GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames()[0], Font.BOLD, 36));


fails to fetch the correct character set. For example, if the title string is "Chess" then on the final page I see printed "Uxecc" in what appears to be a Cyrillic character set.
I guess I must be missing a setting in my system so that Java can find this resource, but don't know at this point if I should be setting something in Eclipse or the system itself.
Re: Referring to fonts in Java on openSUSE 12.3 [message #1125578 is a reply to message #1125472] Fri, 04 October 2013 17:12 Go to previous messageGo to next message
David Wegener is currently offline David WegenerFriend
Messages: 1445
Registered: July 2009
Senior Member
Have you check to see what is returned at element 0 when you call getAvailableFontFamilyNames() on your system? This will be the name used when creating the font. The list that is returned is all font families available on your system.

Note that this isn't really an Eclipse JDT question but a general Java programming question. This isn't a general Java programming forum.
Re: Referring to fonts in Java on openSUSE 12.3 [message #1125598 is a reply to message #1125578] Fri, 04 October 2013 17:37 Go to previous message
Colin Beckingham is currently offline Colin BeckinghamFriend
Messages: 2
Registered: October 2013
Junior Member
OK sorry about that, I guess I thought that there might be a setting required that would be discoverable in Eclipse, which seems to have a large number of options. I'll do some more digging. Thanks.
Previous Topic:Kepler breakpoints nor working
Next Topic:Hamcrest conflict with JUnit runner - signed/unsigned jars
Goto Forum:
  


Current Time: Tue Apr 23 06:41:31 GMT 2024

Powered by FUDForum. Page generated in 0.03271 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top