0

My application uses Thai fonts. They do not get displayed on Linux machine.

I am developing in Windows 10, Java 6, my Linux machine is running Debian 8.7 (Jessie).

On windows it displays properly but on Linux wen I run the jar file, all it shows are squares.

Pitcure: showing  example of the problem

But when I enclose the text in HTML tag it works properly.

getLabel().setText("<html><center>"+ labelText+"</center></html>");

This works

Can anyone help with following issue?

Andrew Thompson
  • 168,117
  • 40
  • 217
  • 433
jackson
  • 16
  • 3
  • Are you using a font that can display thai characters? Not all fonts can display all characters. Use getLabel().setFont(new Font("Courier New", Font.ITALIC, 12)); (or something similar) – quant Feb 08 '19 at 16:45
  • yes m using thai fonts, – jackson Feb 11 '19 at 08:59

1 Answers1

-1

You must set the font on the component that should display thai text. The font it currently uses, can not do that, hence the displayed squares. The font you need must contain thai characters.

  • getLabel().setText("
    "+ labelText+"
    "); why does this works with html ?
    – jackson Feb 11 '19 at 15:08
  • Are you talking about html on a web page or html in combination with swing? Swing has a limited html support. Can you show us the code there you actually set the font to the component? The displayed rectangles looks exactly like swings displays characters that are missing. – Just another Java programmer Feb 11 '19 at 16:44
  • thanks for your help, the problem was in the default of the application there was a typo in there, all has been fixed and working fine. – jackson Feb 12 '19 at 09:04