Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Arabic Text Rendering

Reply
Thread Tools

Arabic Text Rendering

 
 
Alex Nazarian
Guest
Posts: n/a
 
      10-26-2004
HI mates
i have a little bit problem
i need to render an arabic text for a report priting application ...
when the arabic text is passed to the method drawString in class
Graphics2D the output will be such as null characters ... what shall
i do ?
 
Reply With Quote
 
 
 
 
Thomas Weidenfeller
Guest
Posts: n/a
 
      10-26-2004
Alex Nazarian wrote
> i have a little bit problem
> i need to render an arabic text for a report priting application ...
> when the arabic text is passed to the method drawString in class
> Graphics2D the output will be such as null characters ... what shall
> i do ?


Follow Sun's guidelines from the SDK documentation:

http://java.sun.com/j2se/1.5.0/docs/guide/intl/

/Thomas
 
Reply With Quote
 
 
 
 
Andrew Thompson
Guest
Posts: n/a
 
      10-27-2004
On 26 Oct 2004 05:40:54 -0700, Alex Nazarian wrote:

> i need to render an arabic text for a report priting application ...
> when the arabic text is passed to the method drawString in class
> Graphics2D the output will be such as null characters ...


See if this little app. gives you any ideas.
<http://www.physci.org/launcher.jsp#JArabicInUnicode>

Note that early VM's (both MS 1.1.4 and Symantec 1.1.5)
render this text backwards, but since it is Swing based,
that problem is avoided.)

HTH

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
Mickey Segal
Guest
Posts: n/a
 
      10-27-2004
http://www.physci.org/launcher.jsp?c...rabicInUnicode fails
for me on Java 1.5.0 on Windows XP, reporting the following:

java.lang.ClassFormatError: Truncated class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknow n Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadCode(Unknown Source)
at sun.applet.AppletPanel.createApplet(Unknown Source)
at sun.plugin.AppletViewer.createApplet(Unknown Source)
at sun.applet.AppletPanel.runLoader(Unknown Source)
at sun.applet.AppletPanel.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      10-27-2004
On Wed, 27 Oct 2004 05:18:53 -0400, Mickey Segal wrote:

> http://www.physci.org/launcher.jsp?c...rabicInUnicode fails
> for me on Java 1.5.0 on Windows XP, reporting the following:
>
> java.lang.ClassFormatError: Truncated class file


I just tried it using IE 6.0026 and..
Java(TM) Plug-in: version 1.5.0
Using JRE version 1.5.0-beta Java HotSpot(TM) Client VM

It seems to work fine here.

Are you using beta or the RC release?
<http://www.physci.org/pc/property.jsp?prop=java.version>

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
Mickey Segal
Guest
Posts: n/a
 
      10-27-2004
"Andrew Thompson" <> wrote in message
news0zgeu8whlgt$.1jsikxgkzfi8q$... .
> Are you using beta or the RC release?
> <http://www.physci.org/pc/property.jsp?prop=java.version>


I'm using 1.5.0, not the preliminary versions. Do I need an additional
download for the Swing part?


 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      10-27-2004
On Wed, 27 Oct 2004 08:55:57 -0400, Mickey Segal wrote:

> "Andrew Thompson" <> wrote in message
> news0zgeu8whlgt$.1jsikxgkzfi8q$... .
>> Are you using beta or the RC release?
>> <http://www.physci.org/pc/property.jsp?prop=java.version>

>
> I'm using 1.5.0, not the preliminary versions. Do I need an additional
> download for the Swing part?


(scratches head) No, it is all standard Java API Swing classes.
The code is directly below the launcher.

You can get the unformatted source here.
<http://www.physci.org/codes/display.jsp?fmt=raw&fl=/codes/eg/JArabicInUnicode.java>

It should work in Java 1.2+. theoretically, ..checks in
the on-line compiler, no, the call to JFrame.EXIT_ON_CLOSE
on line 69 makes it 1.3+.

I would like to here from other beta and RC users of 1.5.

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
steve
Guest
Posts: n/a
 
      10-27-2004
On Wed, 27 Oct 2004 17:18:53 +0800, Mickey Segal wrote
(in article <keqdnclDzohk-uLcRVn->):

> http://www.physci.org/launcher.jsp?c...rabicInUnicode fails
> for me on Java 1.5.0 on Windows XP, reporting the following:
>
> java.lang.ClassFormatError: Truncated class file
> at java.lang.ClassLoader.defineClass1(Native Method)
> at java.lang.ClassLoader.defineClass(Unknown Source)
> at java.security.SecureClassLoader.defineClass(Unknow n Source)
> at java.net.URLClassLoader.defineClass(Unknown Source)
> at java.net.URLClassLoader.access$100(Unknown Source)
> at java.net.URLClassLoader$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at java.net.URLClassLoader.findClass(Unknown Source)
> at sun.applet.AppletClassLoader.findClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.applet.AppletClassLoader.loadClass(Unknown Source)
> at java.lang.ClassLoader.loadClass(Unknown Source)
> at sun.applet.AppletClassLoader.loadCode(Unknown Source)
> at sun.applet.AppletPanel.createApplet(Unknown Source)
> at sun.plugin.AppletViewer.createApplet(Unknown Source)
> at sun.applet.AppletPanel.runLoader(Unknown Source)
> at sun.applet.AppletPanel.run(Unknown Source)
> at java.lang.Thread.run(Unknown Source)
>
>


it looks like it is corrupted.

java.lang.ClassFormatError: Truncated class file

 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      10-28-2004
On Thu, 28 Oct 2004 05:38:49 +0800, steve wrote:

> On Wed, 27 Oct 2004 17:18:53 +0800, Mickey Segal wrote
> (in article <keqdnclDzohk-uLcRVn->):
>
>> http://www.physci.org/launcher.jsp?c...rabicInUnicode fails
>> for me on Java 1.5.0 on Windows XP, reporting the following:
>>
>> java.lang.ClassFormatError: Truncated class file

...
> it looks like it is corrupted.
>
> java.lang.ClassFormatError: Truncated class file


A couple of details missing from your report steve.
 
Reply With Quote
 
Andrew Thompson
Guest
Posts: n/a
 
      10-28-2004
On Thu, 28 Oct 2004 05:38:49 +0800, steve wrote:

> On Wed, 27 Oct 2004 17:18:53 +0800, Mickey Segal wrote
> (in article <keqdnclDzohk-uLcRVn->):
>
>> http://www.physci.org/launcher.jsp?c...rabicInUnicode fails
>> for me on Java 1.5.0 on Windows XP, reporting the following:
>>
>> java.lang.ClassFormatError: Truncated class file

...
> it looks like it is corrupted.
>
> java.lang.ClassFormatError: Truncated class file


A couple of things missing from your report steve..

a) did you visit the page, or are you just repeating
what Mickey reported?

b) If you visited and got that exception, what exact Java/OS
are you running? (See the properties applet..
<http://www.physci.org/pc/property.jsp?prop=java.version+os.name>)

--
Andrew Thompson
http://www.PhySci.org/codes/ Web & IT Help
http://www.PhySci.org/ Open-source software suite
http://www.1point1C.org/ Science & Technology
http://www.LensEscapes.com/ Images that escape the mundane
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing Arabic text to a PDF file Swetha Java 10 10-11-2007 12:39 PM
Saving Arabic Text Khan Java 1 05-02-2006 05:24 AM
Arabic text displayed as question marks Swetha Java 16 12-13-2005 10:36 PM
when i try to insert or update text in arabic it appears "????" mansour via DotNetMonster.com ASP .Net 1 09-11-2005 12:42 PM
Displaying Arabic text in XML suhaddad@gmail.com XML 3 03-01-2005 04:08 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57