You are not logged in.

#1 2010-10-14 05:21:56

Hund
Member
From: Sweden
Registered: 2010-03-22
Posts: 479
Website

How to change the default font i Sun Java?

I'm feeling really stupid atm, I found the Wiki page* about changing the font. But I couldnt get it to work, so I would appreciate if someone could explain it for me how to change the font to Sans. smile

* http://wiki.archlinux.org/index.php/Jav … _-_Sun_JRE

Offline

#2 2010-10-14 10:59:51

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: How to change the default font i Sun Java?

'Sans' is an alias for another font.  To find the font that will be substituted when an app calls for the 'Sans' font use 'fc-match':

thisoldman@archlinux ~ $ fc-match Sans
DejaVuSans.ttf: "DejaVu Sans" "Book"

This tells me 'Sans' is actually 'DejaVu Sans Book'.  The results will vary from user to user depending on how they have their fonts configured.

Using 'xfontsel' I eventually find I want something based on

-*-dejavu sans-medium-*-*-*-*-*-*-*-*-*-*-*

After further exploration using 'xfontsel', the appropriate sections of my /opt/java/jre/lib/fontconfig.properties are finally written as:

sansserif.plain.latin-1=-misc-dejavu sans-medium-r-normal-*-*-%d-*-*-p-*-iso8859-1
sansserif.bold.latin-1=-misc-dejavu sans-bold-r-normal-*-*-%d-*-*-p-*-iso8859-1
sansserif.italic.latin-1=-misc-dejavu sans-medium-o-normal-*-*-%d-*-*-p-*-iso8859-1
sansserif.bolditalic.latin-1=-misc-dejavu sans-bold-o-normal-*-*-%d-*-*-p-*-iso8859-1

dialog.plain.latin-1=-misc-dejavu sans-medium-r-normal-*-*-%d-*-*-p-*-iso8859-1
dialog.bold.latin-1=-misc-dejavu sans-bold-r-normal-*-*-%d-*-*-p-*-iso8859-1
dialog.italic.latin-1=-misc-dejavu sans-medium-o-normal-*-*-%d-*-*-p-*-iso8859-1
dialog.bolditalic.latin-1=-misc-dejavu sans-bold-o-normal-*-*-%d-*-*-p-*-iso8859-1

Offline

#3 2010-10-14 13:52:07

Hund
Member
From: Sweden
Registered: 2010-03-22
Posts: 479
Website

Re: How to change the default font i Sun Java?

Thanks! That worked. smile How do I change the text size? It's a bit small now, I would like to have size 8-9.

Offline

#4 2010-10-15 04:21:22

thisoldman
Member
From: Pittsburgh
Registered: 2009-04-25
Posts: 1,172

Re: How to change the default font i Sun Java?

I've never tried to specify an exact font size; I've always let the java app select its own default.

Offline

Board footer

Powered by FluxBB