Arabic Text Rendering

Discussion in 'Java' started by Alex Nazarian, Oct 26, 2004.

  1. 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 ?
     
    Alex Nazarian, Oct 26, 2004
    #1
    1. Advertising

  2. 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
     
    Thomas Weidenfeller, Oct 26, 2004
    #2
    1. Advertising

  3. 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
     
    Andrew Thompson, Oct 27, 2004
    #3
  4. Alex Nazarian

    Mickey Segal Guest

    http://www.physci.org/launcher.jsp?class=/codes/eg/JArabicInUnicode 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(Unknown 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)
     
    Mickey Segal, Oct 27, 2004
    #4
  5. On Wed, 27 Oct 2004 05:18:53 -0400, Mickey Segal wrote:

    > http://www.physci.org/launcher.jsp?class=/codes/eg/JArabicInUnicode 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
     
    Andrew Thompson, Oct 27, 2004
    #5
  6. Alex Nazarian

    Mickey Segal Guest

    "Andrew Thompson" <> wrote in message
    news:eek:0zgeu8whlgt$.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?
     
    Mickey Segal, Oct 27, 2004
    #6
  7. On Wed, 27 Oct 2004 08:55:57 -0400, Mickey Segal wrote:

    > "Andrew Thompson" <> wrote in message
    > news:eek:0zgeu8whlgt$.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
     
    Andrew Thompson, Oct 27, 2004
    #7
  8. Alex Nazarian

    steve Guest

    On Wed, 27 Oct 2004 17:18:53 +0800, Mickey Segal wrote
    (in article <>):

    > http://www.physci.org/launcher.jsp?class=/codes/eg/JArabicInUnicode 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(Unknown 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
     
    steve, Oct 27, 2004
    #8
  9. 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 <>):
    >
    >> http://www.physci.org/launcher.jsp?class=/codes/eg/JArabicInUnicode 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.
     
    Andrew Thompson, Oct 28, 2004
    #9
  10. 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 <>):
    >
    >> http://www.physci.org/launcher.jsp?class=/codes/eg/JArabicInUnicode 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
     
    Andrew Thompson, Oct 28, 2004
    #10
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. mansour via DotNetMonster.com

    when i try to insert or update text in arabic it appears "????"

    mansour via DotNetMonster.com, Sep 11, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    778
    Juan T. Llibre
    Sep 11, 2005
  2. Swetha
    Replies:
    16
    Views:
    7,528
    Roedy Green
    Dec 13, 2005
  3. Swetha
    Replies:
    10
    Views:
    8,689
    sajitha
    Oct 11, 2007
  4. Replies:
    3
    Views:
    12,378
    Martin Honnen
    Mar 1, 2005
Loading...

Share This Page