Results 1 to 4 of 4
  1. #1
    netvaibhav is offline Member
    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    Default Incorrect Bengali font rendering

    I have created a simple Hello World swing application, which just displays a label with unicode string.
    Java Code:
    JLabel label = new JLabel("Hello नमस्ते বাংলা");
    The English and Hindi part is displayed correctly, while the Bengali part is not displayed correctly (boxes are seen in place of the expected text). See attached file which shows the rendered text...

    If I System.out.println the text, it get printed properly in my Eclipse console window.

    Any hints as to why Bengali text is not getting rendered properly?

    Thanks
    Attached Thumbnails Attached Thumbnails Incorrect Bengali font rendering-screenshot-helloworldswing.png  

  2. #2
    Horcrux7 is offline Member
    Join Date
    Sep 2010
    Posts
    33
    Rep Power
    0

    Default

    This means in the logical font "Dialog" are no Bengali characters. Which real font is use for the different characters are define in the fontconfig.properties of the Java VM.

    You have 2 options:
    You modify the fontconfig.properties and add a range for Bengali characters. This can e a little tricky.
    Or you set font for you label that can show Bengali characters. The problem can be that you show some of the other characters wrong. There does not exist a font that include all characters. That there are the logical (composite) fonts that mix multiple real font to one font.
    Volker Berlin
    www.inetsoftware.de

  3. #3
    netvaibhav is offline Member
    Join Date
    Oct 2010
    Posts
    2
    Rep Power
    0

    Default

    Thanks for the reply!
    I explicitly set a font having Bengali characters. Now the Bengali characters are displayed properly, but other characters display boxes. This solves my issue for the time being though.

    I was wondering why Bengali (the issue is also observed for Oriya) characters are not displayed properly, while Devanagari ones are shown without problems. In this age of multi-language computing, things should work out of the box. Is this a bug that needs to be reported to the Java developers?

  4. #4
    Horcrux7 is offline Member
    Join Date
    Sep 2010
    Posts
    33
    Rep Power
    0

    Default

    You can post it to Oracle. But I worry your language is not important enough. The same problem has also some European languages like Georgian which not use Latin characters.

    The core question is: Has your OS (Windows?) a default font for your language or must install it self. The file fontconfig.properties is a static file. That it used only default fonts from the different OS.
    Volker Berlin
    www.inetsoftware.de

Similar Threads

  1. Replies: 0
    Last Post: 08-18-2010, 11:31 AM
  2. What in my function incorrect?
    By artemff in forum New To Java
    Replies: 5
    Last Post: 01-02-2010, 05:25 PM
  3. Replies: 5
    Last Post: 04-25-2009, 09:00 PM
  4. Incorrect Package? Help!
    By chaits86 in forum NetBeans
    Replies: 10
    Last Post: 12-17-2008, 04:08 AM
  5. The addition program is providing incorrect sum '0'
    By tabrez_k81 in forum New To Java
    Replies: 4
    Last Post: 12-16-2008, 02:43 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •