Home pageFind It!Contact PJAPJA documentation

PJA

 PJA Toolkit forum

This forum is dedicated to PJA Toolkit.
You may read freely the messages it contents. If you want to write a message or answer to a subject, subscribe to it first.

Subjects Recent messages Login Subscribe

Messages of subject No Fonts Appear on AIX

Kevbo

Location : Canada
Member since : Oct 10, 2003
Messages : 2
 Oct 10, 2003 at 12:45 AM
Hi,

I've read through similar topics on the forum, and have read web-sites on the internet. But I cannot come up with a solution that works for me.

I'm trying to run a batch program on an IBM AIX 5.2 box with Websphere 5.0.0 installed. I'd like to avoid permanently altering the Websphere variables if possible. Everything runs great, until I take a look at my results. What I'm doing is placing a string onto an image and then saving the image to disk. When I look at the image, my string is not there. The program was working earlier with an X-Win32 session running (provides a DISPLAY). However, once I publish this program having an X-Win32 session is not an option. It just seems as if my program is not picking up the fonts... Everything else seems to be working properly.

Here's the contents of my script file:

#!/usr/bin/ksh

umask 007

WAS_HOME=/usr/IBMWebAS
export WAS_HOME

JAVA_HOME=$WAS_HOME/java
export JAVA_HOME

PJA_HOME=/var/ltb/imagelibtest
export PJA_HOME

CLASSPATH=$CLASSPATH:/var/ltb/imagelibtest
CLASSPATH=$CLASSPATH:/var/ltb/imagelibtest/ImageLibTest.jar
CLASSPATH=$CLASSPATH:/var/ltb/imagelibtest/imagelib.jar
CLASSPATH=$CLASSPATH:/var/bcol/libs/lib/snow.jar
CLASSPATH=$CLASSPATH:$PJA_HOME/pja.jar
CLASSPATH=$CLASSPATH:$PJA_HOME/pjatools.jar

CLASSPATH=.:$CLASSPATH
export CLASSPATH

JAVA_EXE=$JAVA_HOME/jre/bin/java

${JAVA_EXE?} -Djava.compiler=none -Xbootclasspath/a:$PJA_HOME/pja.jar -Dawt.toolkit=com.eteks.awt.PJAToolkit -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment -Djava2d.font.usePlatformFont=false -Djava.awt.fonts=$JAVA_HOME/jre/lib/fonts -Duser.home=$PJA_HOME -cp $CLASSPATH ca.bc.gov.srm.ltb.dds.idm.imagelibtest.ImageLibTest



The pja.jar, pjatoolkit.jar and font.properties file is contained within $PJA_HOME (/var/ltb/imagelibtest). I've checked my fonts directory, and there are .ttf available. What am I doing wrong?

Also, is there any good documentation you can refer me too? I've been dissappointed in the amount of documentation I've been able to find on installing PJA.

Thanks!
Kevin

Kevbo

Location : Canada
Member since : Oct 10, 2003
Messages : 2
 Oct 11, 2003 at 12:11 AM
Got it. It works! This page was extremely helpful in finding a solution:
http://java.quest.com/support/search/JclServerChart/fq/jcl_serverchart_fq_13.html

A correction on the page though. It states that you need to copy ALL fonts from Windows. The only font I needed to copy was Arial. In fact, the only font I could get it to use was Arial. This might have something to do with my font.properties file. I don't know... I only need one font that looks half decent anyways.

Here are the exact files you'll need to copy:
arial.ttf arialbd.ttf arialbi.ttf ariali.ttf ariblk.ttf

Hope this helps people in the future,
Kevin

phamdinhnguyen

Location : boston. ma
Member since : Feb 6, 2004
Messages : 7
 Feb 6, 2004 at 12:20 AM
~~~I ran two certification tools provided in PJA download: the DefaultToolKitTest servlet, and the PJAToolkitDemo application. Both indicate success.
~~~This is how I ran the PJAToolkitDemo application:

java -Xbootclasspath/a:../lib/pja.jar -Dawt.toolkit=com.eteks.awt.PJAToolkit -Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment -Djava2d.font.usePlatformFont=false -Djava.awt.fonts=/usr/java131/jre/lib/fonts -Duser.home=/u/mydir -classpath ../lib/pjatools.jar ToolkitDemo

where /u/mydir/lib/font.properties file comes from PJA.

~~~The output of this PJAToolkitDemo application is:

Toolkit demo
¬ Copyright 2000-2001 eTeks <info@eteks.com>.
¬ Copyright 1996,1998 by Jef Poskanzer <jef@acme.com>.

Disabling platform fonts
Toolkit class in use is com.eteks.awt.PJAToolkit
Computing ArcDrawer image (instance of com.eteks.java2d.PJABufferedImage)
Saving image to PJAToolkitArcDrawer.gif
Computing PolygonDrawer image (instance of com.eteks.java2d.PJABufferedImage)
Saving image to PJAToolkitPolygonDrawer.gif
Computing TextDrawer image (instance of com.eteks.java2d.PJABufferedImage)
Saving image to PJAToolkitTextDrawer.gif
Computing ImageDrawer image (instance of com.eteks.java2d.PJABufferedImage)
Saving image to PJAToolkitImageDrawer.gif

~~~Nevertheless, the file PJAToolkitTextDrawer.gif has no text in it, size of only 336 bytes.
~~~Numerous attempts to play with -Duser.home has yielded all but failures.
~~~Please help.

[Message from Moderator : moved this message to the closest AIX subject as phamdinhnguyen targets AIX]

phamdinhnguyen

Location : boston. ma
Member since : Feb 6, 2004
Messages : 7
 Feb 6, 2004 at 10:09 PM
There're numerous posts on this forum, as well as others, looking for solution dealing with PJA Toolkit, specifically the failure that creates an empty PJAToolkitTextDrawer.gif, as early as in 2002, and as recent as right now.

Few who are lucky to get the text to display pointed out the following settings (I skipped the GUI interaction with Websphere Admin Console):

-Xbootclasspath/a:$PJA_HOME/lib/pja.jar
-Dawt.toolkit=com.eteks.awt.PJAToolkit
-Djava.awt.graphicsenv=com.eteks.java2d.PJAGraphicsEnvironment
-Djava2d.font.usePlatformFont=false
-Djava.awt.fonts=$JAVA_HOME/jre/lib/fonts
-Duser.home=$PJA_HOME
-classpath $PJA_HOME/lib/pjatools.jar

where $JAVA_HOME is the home directory for Java, i.e /usr/java131, and
$JPA_HOME is the home directory for Pure Java AWT, i.e /usr/jpa_2.4

Not every posts in this forums on the subject of "empty PJAToolkitTextDrawer.gif" indicates the problem was resolved.
Unfortunately, my case is yet another failure, despite of extensive research on the internet (and that's how I know the large scope of this problem)

If you can share your thoughts here, I & many would appreciate that!

[Message from Moderator : moved this message to the closest AIX subject as phamdinhnguyen targets AIX]

phamdinhnguyen

Location : boston. ma
Member since : Feb 6, 2004
Messages : 7
 Feb 10, 2004 at 6:01 PM
My final working solution for AIX, after exhausting all possible settings is XVFB. If you MUST get a solution, check out this link for details:

http://publibn.boulder.ibm.com/doc_link/en_US/a_doc_lib/aixprggd/aixwnpgd/xvfb.htm#Header_363

Best luck!

anotherpjauser

Member since : Mar 9, 2004
Messages : 1
 Mar 9, 2004 at 11:41 PM
> Got it. It works! This page was extremely helpful in finding a solution:
> http://java.quest.com/support/search/JclServerChart/fq/jcl_serverchart_fq_13.html
>
> A correction on the page though. It states that you need to copy ALL fonts from Windows. The only font I needed to copy was Arial. In fact, the only font I could get it to use was Arial. This might have something to do with my font.properties file. I don't know... I only need one font that looks half decent anyways.
>
> Here are the exact files you'll need to copy:
> arial.ttf arialbd.ttf arialbi.ttf ariali.ttf ariblk.ttf
>
> Hope this helps people in the future,
> Kevin


I just tried this workaround procedure and it didn't work under JRE 1.3.1, but it does work for JRE 1.3.0!

But without the workaround, I can't get text to display regardless of the JRE version.

I'd rather not have to require using Xvfb, so is there someway to get PJA to work with JRE 1.3.1?

lemval

Member since : May 21, 2004
Messages : 5
 May 24, 2004 at 11:51 AM
Change the script (PJAToolkitDemo1.2.sh) to include the line:
-Dcom.eteks.awt.nojava2d=true \

This should make the demo work.

In your private code, make sure you do NOT use 'new PJAGraphicsEnvironment()'. This also results in no text within graphics.


Home pageFind It!ContactTop

© Copyrights 1997-2014 eTeks - All rights reserved

PJAPJA documentation