Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nice fonts in Java programs
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
cohesion
n00b
n00b


Joined: 27 Aug 2002
Posts: 24
Location: KC, MO, USA

PostPosted: Thu Jun 19, 2003 3:18 pm    Post subject: nice fonts in Java programs Reply with quote

Here is the /opt/<sun-j2version>/jre/lib/font.properties for using the nice new Bitstream Vera Fonts for all of the dialogs in your Java applications. Also, due to a bug in java, copy your favorite True Type Fonts from /usr/X11R6/lib/X11/fonts/ttf|truetype/* to /opt/<sun-j2version>/jre/lib/fonts/ so that the JRE can see them. Enjoy pretty java applets!

Edit: woops! Originally posted the Win32 version! Doh! Here is the corrected version:

Edit #2: woops again! Okay, I'm certain this is the correct one. It works for me. (Sorry!) Enjoy! BTW, this also enables Unicode support that may not have been there before. If you have trouble with certain characters showing up as empty blocks, replace all occurances of 'iso10646' with 'iso8859'.

Code:
# @(#)font.properties.linux   1.7 02/03/07
#
# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
#

# Component Font Mappings
#
serif.0=-bitstream-bitstream vera serif-medium-r-normal--*-%d-*-*-p-*-iso10646-1
serif.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

serif.italic.0=-bitstream-bitstream vera serif-medium-i-normal--*-%d-*-*-p-*-iso10646-1
serif.italic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

serif.bold.0=-bitstream-bitstream vera serif-demibold-r-normal--*-%d-*-*-p-*-iso10646-1
serif.bold.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

serif.bolditalic.0=-bitstream-bitstream vera serif-demibold-i-normal--*-%d-*-*-p-*-iso10646-1
serif.bolditalic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

sansserif.0=-bitstream-bitstream vera sans-medium-r-normal-sans-*-%d-*-*-p-*-iso10646-1
sansserif.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

sansserif.italic.0=-bitstream-bitstream vera sans-medium-i-normal-sans-*-%d-*-*-p-*-iso10646-1
sansserif.italic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

sansserif.bold.0=-bitstream-bitstream vera sans-bold-r-normal-sans-*-%d-*-*-p-*-iso10646-1
sansserif.bold.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

sansserif.bolditalic.0=-bitstream-bitstream vera sans-bold-i-normal-sans-*-%d-*-*-p-*-iso10646-1
sansserif.bolditalic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

monospaced.0=-bitstream-bitstream vera sans mono-medium-r-normal-sans-*-%d-*-*-m-*-iso10646-1
monospaced.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

monospaced.italic.0=-bitstream-bitstream vera sans mono-medium-i-normal-sans-*-%d-*-*-m-*-iso10646-1
monospaced.italic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

monospaced.bold.0=-bitstream-bitstream vera sans mono-bold-r-normal-sans-*-%d-*-*-m-*-iso10646-1
monospaced.bold.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

monospaced.bolditalic.0=-bitstream-bitstream vera sans mono-bold-i-normal-sans-*-%d-*-*-m-*-iso10646-1
monospaced.bolditalic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

dialog.0=-bitstream-bitstream vera sans-medium-r-normal-sans-*-%d-*-*-p-*-iso10646-1
dialog.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

dialog.italic.0=-bitstream-bitstream vera sans-medium-i-normal-sans-*-%d-*-*-p-*-iso10646-1
dialog.italic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

dialog.bold.0=-bitstream-bitstream vera sans-bold-r-normal-sans-*-%d-*-*-p-*-iso10646-1
dialog.bold.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

dialog.bolditalic.0=-bitstream-bitstream vera sans-bold-i-normal-sans-*-%d-*-*-p-*-iso10646-1
dialog.bolditalic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

dialoginput.0=-bitstream-bitstream vera sans mono-medium-r-normal-sans-*-%d-*-*-m-*-iso10646-1
dialoginput.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

dialoginput.italic.0=-bitstream-bitstream vera sans mono-medium-i-normal-sans-*-%d-*-*-m-*-iso10646-1
dialoginput.italic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

dialoginput.bold.0=-bitstream-bitstream vera sans mono-bold-r-normal-sans-*-%d-*-*-m-*-iso10646-1
dialoginput.bold.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

dialoginput.bolditalic.0=-bitstream-bitstream vera sans mono-bold-i-normal-sans-*-%d-*-*-m-*-iso10646-1
dialoginput.bolditalic.1=--standard symbols l-medium-r-normal--*-%d-*-*-p-*-urw-fontspecific

# Missing Glyph Character
#
default.char=274f

# Component Font Character Encodings
#
fontcharset.serif.0=sun.io.CharToByteISO8859_1
fontcharset.serif.1=sun.awt.CharToByteSymbol

fontcharset.sansserif.0=sun.io.CharToByteISO8859_1
fontcharset.sansserif.1=sun.awt.CharToByteSymbol

fontcharset.monospaced.0=sun.io.CharToByteISO8859_1
fontcharset.monospaced.1=sun.awt.CharToByteSymbol

fontcharset.dialog.0=sun.io.CharToByteISO8859_1
fontcharset.dialog.1=sun.awt.CharToByteSymbol

fontcharset.dialoginput.0=sun.io.CharToByteISO8859_1
fontcharset.dialoginput.1=sun.awt.CharToByteSymbol

# Exclusion Ranges
#

# XFontSet Information
#
fontset.serif.plain=\
-bitstream-bitstream vera serif-medium-r-normal--*-%d-*-*-p-*-iso10646-1

fontset.serif.italic=\
-bitstream-bitstream vera serif-medium-i-normal--*-%d-*-*-p-*-iso10646-1

fontset.serif.bold=\
-bitstream-bitstream vera serif-demibold-r-normal--*-%d-*-*-p-*-iso10646-1

fontset.serif.bolditalic=\
-bitstream-bitstream vera serif-demibold-i-normal--*-%d-*-*-p-*-iso10646-1

fontset.sansserif.italic=\
-bitstream-lucida-medium-i-normal-sans-*-%d-*-*-p-*-iso10646-1

fontset.sansserif.bold=\
-bitstream-lucida-bold-r-normal-sans-*-%d-*-*-p-*-iso10646-1

fontset.sansserif.bolditalic=\
-bitstream-lucida-bold-i-normal-sans-*-%d-*-*-p-*-iso10646-1

fontset.sansserif.plain=\
-bitstream-lucida-medium-r-normal-sans-*-%d-*-*-p-*-iso10646-1

fontset.monospaced.italic=\
-bitstream-bitstream vera sans mono-medium-r-normal-sans-*-%d-*-*-m-*-iso10646-1

fontset.monospaced.bold=\
-bitstream-bitstream vera sans mono-bold-r-normal-sans-*-%d-*-*-m-*-iso10646-1

fontset.monospaced.bolditalic=\
-bitstream-bitstream vera sans mono-bold-r-normal-sans-*-%d-*-*-m-*-iso10646-1

fontset.monospaced.plain=\
-bitstream-bitstream vera sans mono-medium-r-normal-sans-*-%d-*-*-m-*-iso10646-1

fontset.dialog.italic=\
-bitstream-lucida-medium-i-normal-sans-*-%d-*-*-p-*-iso10646-1

fontset.dialog.bold=\
-bitstream-lucida-bold-r-normal-sans-*-%d-*-*-p-*-iso10646-1

fontset.dialog.bolditalic=\
-bitstream-lucida-bold-i-normal-sans-*-%d-*-*-p-*-iso10646-1

fontset.dialog.plain=\
-bitstream-lucida-medium-r-normal-sans-*-%d-*-*-p-*-iso10646-1

fontset.dialoginput.italic=\
-bitstream-bitstream vera sans mono-medium-r-normal-sans-*-%d-*-*-m-*-iso10646-1

fontset.dialoginput.bold=\
-bitstream-bitstream vera sans mono-bold-r-normal-sans-*-%d-*-*-m-*-iso10646-1

fontset.dialoginput.bolditalic=\
-bitstream-bitstream vera sans mono-bold-r-normal-sans-*-%d-*-*-m-*-iso10646-1

fontset.dialoginput.plain=\
-bitstream-bitstream vera sans mono-medium-r-normal-sans-*-%d-*-*-m-*-iso10646-1

fontset.default=\
-bitstream-lucida-medium-r-normal-sans-*-%d-*-*-p-*-iso10646-1


Last edited by cohesion on Fri Jun 20, 2003 2:37 am; edited 3 times in total
Back to top
View user's profile Send private message
Chickpea
l33t
l33t


Joined: 03 Jun 2002
Posts: 846
Location: Vancouver WA

PostPosted: Thu Jun 19, 2003 3:21 pm    Post subject: Reply with quote

Cool!! Can't wait to try this.

Cat
Back to top
View user's profile Send private message
cohesion
n00b
n00b


Joined: 27 Aug 2002
Posts: 24
Location: KC, MO, USA

PostPosted: Thu Jun 19, 2003 3:29 pm    Post subject: Win32 version Reply with quote

Since many people use both operating system and you CAN use the Vera fonts in Windows (I love them), here is the same file for Java for Windows:

Code:
# @(#)font.properties   1.13 02/03/07
#
# Copyright 2002 Sun Microsystems, Inc. All rights reserved.
#

# Component Font Mappings
#
dialog.0=Bitstream Vera Sans,ANSI_CHARSET
dialog.1=WingDings,SYMBOL_CHARSET
dialog.2=Symbol,SYMBOL_CHARSET

dialog.bold.0=Bitstream Vera Sans Bold,ANSI_CHARSET
dialog.bold.1=WingDings,SYMBOL_CHARSET
dialog.bold.2=Symbol,SYMBOL_CHARSET

dialog.italic.0=Bitstream Vera Sans Oblique,ANSI_CHARSET
dialog.italic.1=WingDings,SYMBOL_CHARSET
dialog.italic.2=Symbol,SYMBOL_CHARSET

dialog.bolditalic.0=Bitstream Vera Sans Bold Oblique,ANSI_CHARSET
dialog.bolditalic.1=WingDings,SYMBOL_CHARSET
dialog.bolditalic.2=Symbol,SYMBOL_CHARSET

dialoginput.0=Bitstream Vera Sans Mono,ANSI_CHARSET
dialoginput.1=WingDings,SYMBOL_CHARSET
dialoginput.2=Symbol,SYMBOL_CHARSET

dialoginput.bold.0=Bitstream Vera Sans Mono Bold,ANSI_CHARSET
dialoginput.bold.1=WingDings,SYMBOL_CHARSET
dialoginput.bold.2=Symbol,SYMBOL_CHARSET

dialoginput.italic.0=Bitstream Vera Sans Mono Oblique,ANSI_CHARSET
dialoginput.italic.1=WingDings,SYMBOL_CHARSET
dialoginput.italic.2=Symbol,SYMBOL_CHARSET

dialoginput.bolditalic.0=Bitstream Vera Sans Mono Bold Oblique,ANSI_CHARSET
dialoginput.bolditalic.1=WingDings,SYMBOL_CHARSET
dialoginput.bolditalic.2=Symbol,SYMBOL_CHARSET

serif.0=Bitstream Vera Serif,ANSI_CHARSET
serif.1=WingDings,SYMBOL_CHARSET
serif.2=Symbol,SYMBOL_CHARSET

serif.bold.0=Bitstream Vera Serif Bold,ANSI_CHARSET
serif.bold.1=WingDings,SYMBOL_CHARSET
serif.bold.2=Symbol,SYMBOL_CHARSET

serif.italic.0=Bitstream Vera Serif Oblique,ANSI_CHARSET
serif.italic.1=WingDings,SYMBOL_CHARSET
serif.italic.2=Symbol,SYMBOL_CHARSET

serif.bolditalic.0=Bitstream Vera Serif Bold Oblique,ANSI_CHARSET
serif.bolditalic.1=WingDings,SYMBOL_CHARSET
serif.bolditalic.2=Symbol,SYMBOL_CHARSET

sansserif.0=Bitstream Vera Sans,ANSI_CHARSET
sansserif.1=WingDings,SYMBOL_CHARSET
sansserif.2=Symbol,SYMBOL_CHARSET

sansserif.bold.0=Bitstream Vera Sans Bold,ANSI_CHARSET
sansserif.bold.1=WingDings,SYMBOL_CHARSET
sansserif.bold.2=Symbol,SYMBOL_CHARSET

sansserif.italic.0=Bitstream Vera Sans Oblique,ANSI_CHARSET
sansserif.italic.1=WingDings,SYMBOL_CHARSET
sansserif.italic.2=Symbol,SYMBOL_CHARSET

sansserif.bolditalic.0=Bitstream Vera Sans Bold Oblique,ANSI_CHARSET
sansserif.bolditalic.1=WingDings,SYMBOL_CHARSET
sansserif.bolditalic.2=Symbol,SYMBOL_CHARSET

monospaced.0=Bitstream Vera Sans Mono,ANSI_CHARSET
monospaced.1=WingDings,SYMBOL_CHARSET
monospaced.2=Symbol,SYMBOL_CHARSET

monospaced.bold.0=Bitstream Vera Sans Mono Bold,ANSI_CHARSET
monospaced.bold.1=WingDings,SYMBOL_CHARSET
monospaced.bold.2=Symbol,SYMBOL_CHARSET

monospaced.italic.0=Bitstream Vera Sans Mono Oblique,ANSI_CHARSET
monospaced.italic.1=WingDings,SYMBOL_CHARSET
monospaced.italic.2=Symbol,SYMBOL_CHARSET

monospaced.bolditalic.0=Bitstream Vera Sans Mono Bold Oblique,ANSI_CHARSET
monospaced.bolditalic.1=WingDings,SYMBOL_CHARSET
monospaced.bolditalic.2=Symbol,SYMBOL_CHARSET

# Font File Names
#
filename.Bitstream_Vera_Sans=Vera.TTF
filename.Bitstream_Vera_Sans_Bold=VeraBd.TTF
filename.Bitstream_Vera_Sans_Oblique=VeraIt.TTF
filename.Bitstream_Vera_Sans_Bold_Oblique=VeraBI.TTF

filename.Bitstream_Vera_Sans_Mono=VeraMono.TTF
filename.Bitstream_Vera_Sans_Mono_Bold=VeraMoBd.TTF
filename.Bitstream_Vera_Sans_Mono_Oblique=VeraMoIt.TTF
filename.Bitstream_Vera_Sans_Mono_Bold_Oblique=VeraMoBI.TTF

filename.Bitstream_Vera_Serif=VeraSe.TTF
filename.Bitstream_Vera_Serif_Bold=VeraSeBd.TTF
filename.Bitstream_Vera_Serif_Oblique=VeraSe.TTF
filename.Bitstream_Vera_Serif_Bold_Oblique=VeraSeBd.TTF

filename.WingDings=WINGDING.TTF
filename.Symbol=SYMBOL.TTF

# Missing Glyph Character
#
default.char=2751

# Component Font Character Encodings
#
fontcharset.dialog.0=sun.io.CharToByteCp1252
fontcharset.dialog.1=sun.awt.windows.CharToByteWingDings
fontcharset.dialog.2=sun.awt.CharToByteSymbol

fontcharset.dialoginput.0=sun.io.CharToByteCp1252
fontcharset.dialoginput.1=sun.awt.windows.CharToByteWingDings
fontcharset.dialoginput.2=sun.awt.CharToByteSymbol

fontcharset.serif.0=sun.io.CharToByteCp1252
fontcharset.serif.1=sun.awt.windows.CharToByteWingDings
fontcharset.serif.2=sun.awt.CharToByteSymbol

fontcharset.sansserif.0=sun.io.CharToByteCp1252
fontcharset.sansserif.1=sun.awt.windows.CharToByteWingDings
fontcharset.sansserif.2=sun.awt.CharToByteSymbol

fontcharset.monospaced.0=sun.io.CharToByteCp1252
fontcharset.monospaced.1=sun.awt.windows.CharToByteWingDings
fontcharset.monospaced.2=sun.awt.CharToByteSymbol

# Exclusion Ranges
#
exclusion.dialog.0=0500-20ab,20ad-ffff
exclusion.dialoginput.0=0500-20ab,20ad-ffff
exclusion.serif.0=0500-20ab,20ad-ffff
exclusion.sansserif.0=0500-20ab,20ad-ffff
exclusion.monospaced.0=0500-20ab,20ad-ffff

# Text Input Character Set
#
inputtextcharset=ANSI_CHARSET
Back to top
View user's profile Send private message
IWBCMAN
Guru
Guru


Joined: 25 Jun 2002
Posts: 474

PostPosted: Tue Jul 15, 2003 2:10 pm    Post subject: Reply with quote

although there is still no anti-aliasing going on-I followed your instructions and all I can say is WOW-massive difference....I really, really like this

I had just downloaded sun-one and netbeans and their IDE's were deplorable, as far as fonts go,I simply have an allergic reaction to standard windows fonts....now everything is clearly legible, I don't need to squint and it looks pretty damned good, if I may say so.

thanks for your effort.....
Back to top
View user's profile Send private message
Lazlo
n00b
n00b


Joined: 25 Jan 2003
Posts: 66
Location: Gl. Lejre, Denmark

PostPosted: Sat Sep 13, 2003 8:22 pm    Post subject: Make it part of the ebuild Reply with quote

It does look kinda cool.

It would be cool to have as a part of the gentoo java ebuild.

I get this error though:
Code:
Warning: Cannot convert string "-bitstream-lucida-medium-r-normal-sans-*-140-*-*-p-*-iso8859-1" to type FontStruct
Back to top
View user's profile Send private message
pascall
Tux's lil' helper
Tux's lil' helper


Joined: 29 Aug 2002
Posts: 101
Location: Montreal, Qc

PostPosted: Sat Oct 04, 2003 12:34 pm    Post subject: Reply with quote

Small problem here...

here 's what i did (i m using blackdown jdk 1.4.1) :
1. Moved my /opt.../font.properties to font.properties.back
2. Created a new font.properties with the one u r giving
3. copied the ttf files from /usr/share/fonts/ttf-bistream-vera to /opt/.../lib/fonts

Problem is that now, every time I try to start an applet external to the web browser (I mainly use a chat applet that pops in its own window), the java vm seems to stall. I ve looked in the java console and there is no error message at all...

Have I forgotten something ? Do I have to regenerate the fonts.dir files and if so how to do it ?

Thanks for your help,

Pascal
Back to top
View user's profile Send private message
Yuber
Tux's lil' helper
Tux's lil' helper


Joined: 08 Jan 2003
Posts: 139

PostPosted: Wed Oct 29, 2003 5:43 pm    Post subject: Reply with quote

how do you get anti aliasing to work?
Back to top
View user's profile Send private message
karan
Tux's lil' helper
Tux's lil' helper


Joined: 15 Feb 2003
Posts: 117
Location: New Zealand

PostPosted: Fri Nov 28, 2003 2:32 pm    Post subject: Reply with quote

Ahh very cool indeed. :) Thanks for the great post.
_________________
:: Project Gotham
Back to top
View user's profile Send private message
warer
n00b
n00b


Joined: 26 Oct 2002
Posts: 38

PostPosted: Fri Feb 20, 2004 10:32 pm    Post subject: Reply with quote

OK i have done as described above with blackdown, the fonts changed.
(They didn't get any nicer more like worse in my opinion)
but my java programs still display square og ? for unicode chars.
Any ideas?
Back to top
View user's profile Send private message
diddledan
n00b
n00b


Joined: 05 Jan 2004
Posts: 63
Location: United Kingdom

PostPosted: Sat Feb 21, 2004 1:27 pm    Post subject: Reply with quote

I can't seem to find Bitstream Vera fonts on my system... Where can I get them from?
Back to top
View user's profile Send private message
warer
n00b
n00b


Joined: 26 Oct 2002
Posts: 38

PostPosted: Sun Feb 22, 2004 5:24 pm    Post subject: Reply with quote

emerge ttf-bitstream-vera
Back to top
View user's profile Send private message
diddledan
n00b
n00b


Joined: 05 Jan 2004
Posts: 63
Location: United Kingdom

PostPosted: Sun Feb 22, 2004 8:41 pm    Post subject: Reply with quote

aha, thankoo for that - bitstream fonts now installed :-D
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum