[TriLUG] java ttf fonts

H Brett Bolen brettb at nc.rr.com
Mon Sep 30 23:11:59 EDT 2002


java question, folks....

I have some custom fonts that my java program needs to use.

The font is loaded by X ( ie XLoadQueryFont(), XSetFont()), and
used via XDrawString():

    char ch = 'C';
    XDrawString( _display, __curOvly, _symbolGC, x,y, &ch,1);

I want to do the same thing using java.

The indexes into this font are strange.  The 'Symbol'
font  is the same way.  The first index used is 913, and the
chars to up to about 980 with a few gaps.  The next valid
characters are between 8700 and 8900.  X and Java also see
a different ordering between the fonts.

There is obviously some mapping that X is taking care of
and I'm not in my java app.

This may not be related, but there is some mention of a
'charset converter' in the jdk docs.  It is put into the
font.properties file.  It appears to do the conversion
the wrong way however.  I dont' see how it could fix
my problem.

Which of you java gurus could lend a hand?  I would like to
use similar code to the way we are doing it in X.  I want to
write a "U" ( instead of '933' ) and get the my ownship symbol
( ttf character) on the java window.

Also, the java docs say that you need to add fonts by editing
font.properties, but once I've added the font to xfree font
server, it automatically appears in the fontlist -- ie

     GraphicsEnvironment.getLocalGraphicsEnvironment.
        getAvilibleFontFamilyNmaes()

I'm using jdk 1.3.something

b



b



-- 
b²

-----------------------
-- H Brett Bolen
-- TCNi
-- Phone: 919 550-0828
-- eFax : 509 752-8446




-- 
b²

-----------------------
-- H Brett Bolen
-- TCNi
-- Phone: 919 550-0828
-- eFax : 509 752-8446






More information about the TriLUG mailing list