1

I upgraded NetBeans from Version 11 to 15. Version 15 is not displaying Hindi characters.

enter image description here

But Version 15 displays other language characters:

enter image description here

Under options, I have the same Fonts & Colors settings defined as Version 11.

enter image description here

Does anyone know how to fix this problem?

Thanks,

Brandon

skomisa
  • 16,436
  • 7
  • 61
  • 102
behofmann
  • 49
  • 8
  • 2
    In your edit window you need to use a font that can render Hindi text, and _Monospaced_ cannot do that; I tried using NetBeans 11 and NetBeans 15. However, if you change the font to _Nirmala UI_ or _Akshar Unicode_ or _Arial Unicode MS_ or _Unifont_ the text will render. Of those, only _Unifont_ is a fixed width font, so that may be your best option for an immediate fix. A better long term approach would be to download and install a fixed width font that supports all of the languages used in your source in NetBeans. Once you find a solution please post an answer here. – skomisa Oct 04 '22 at 16:59
  • Hi skomisa, I've installed Netbeans 15 from the Zip file to make it Portable. My installation doesn't have Unifont. Also my JDK is version 19. Would those two combinations prevent any UTF-8 character rendering? Thanks for all your help! – behofmann Oct 06 '22 at 16:40
  • OK. [1] My bad then - I guess I must have manually added Unifont in the past. Since you don't already have it you can just download it and add it yourself. Lots of sites offer it for free. [2] There have been issues with console rendering that have been both fixed and caused by JDK 18/19. I will test that later, but rendering the glyphs in your edit window (your primary concern?) shouldn't be affected by your JDK. – skomisa Oct 06 '22 at 18:36
  • I updated my answer to show that everything still works for me when using JDK version _19+36-2238_, with the font for _All Languages_ set to _Arial Unicode MS_. I also installed NB 15 from the zip, so if you still have problems try this: [1] Close all edit windows. [2] Set your font for _All Languages_ to _Arial Unicode MS_. [3] Restart NetBeans. [4] Open a Java file in your edit window and copy/paste the Japanese and Hindi text from my answer below. Are the Japanese and Hindi characters still not rendering correctly? – skomisa Oct 09 '22 at 05:23
  • Also, although it's not directly relevant for your question, for the Hindi/Japanese text to render correctly in the **Output** window on Windows you must check _"Beta: Use Unicode UTF-8 for worldwide language support"_ (_Region > Administrative > Change system locale...._ in Control Panel) if using JDK 19. A restart is also required. That setting wasn't necessary when using JDK 11. However, none of that is relevant for properly rendering the text in the edit window; for that you just need an appropriate font. – skomisa Oct 09 '22 at 05:54
  • Skomisa, I sincerely thank you for the time you've been helping me. Since my Netbeans 15 portable installation doesn't have the Arial Unicode MS font you mention, where can I download it? I want to duplicate exactly what you've done so I can verify I get the same results. Thanks again for your help; I don't take it for granted! – behofmann Oct 12 '22 at 16:15
  • I am using Windows 10 and (like you) I installed NetBeans 15 from the downloaded zip file. Arial Unicode MS was available automatically for me; I didn't take any special action to add it. What is your operating system? – skomisa Oct 12 '22 at 16:22
  • I too am using Windows 10. So I'm guessing Netbeans displays fonts available in Windows? – behofmann Oct 12 '22 at 20:09
  • OK. I think the fonts available on a particular NetBeans installation should be a hybrid of fonts supplied by NetBeans and those already existing in directory **C:/Windows/Fonts**, but there may be some issues. Regardless, if you _globally_ install any font on your machine, it should be possible to make that font available to NetBeans, though the process is not necessarily completely straightforward. See [Newly installed fonts do not appear in Netbeans](https://stackoverflow.com/q/55112673/2985643) for more details of the problem, workarounds and solutions. – skomisa Oct 12 '22 at 20:32
  • You are right. Surprisingly, it seems that Windows 10 does not include _Arial Unicode MS_! My machine is old, and may only have it because it was upgraded from Windows 8, and/or I used to have a copy Microsoft Office installed. Anyway, you can download MS Arial Unicode yourself from many sites (e.g. https://www.fonts100.com/font+5092_Arial+Unicode+MS.html), but be cautious when using those sites! Once you have unzipped the download, [follow the instructions here to install it](https://stackoverflow.com/a/68342647/2985643), then restart NetBeans and _MS Arial Unicode_ should be available. – skomisa Oct 12 '22 at 20:46

1 Answers1

1

If you set the font for the NetBeans Edit window to Unifont using Tools > Options > Fonts & Colors > Font then it will render Latin, Japanese and Hindi characters. You don't specify the language(s) you are using, but here is a trivial sample application in Java:

package pkg;

public class HindiJapanese {

    public static void main(String[] args) { // Edit window uses Unifont font.
        System.out.println("Hello World!");        
        System.out.println("Hello world in Hindi:    नमस्ते दुनिया");
        System.out.println("Hello world in Japanese: こんにちは世界");
    }
    
}

You will also need to set the font for the Output window to Unifont using Tools > Options > Miscellaneous > Output > Font before running that code:

Screen shot

Update: Everything still works when using JDK 19 and Arial Unicode MS font, although that font is not fixed width:

Using Arial Unicode MS with JDK 19

Notes:

  • My environment is a NetBeans 15 Java Ant project on Windows 10 using JDK 11.0.12, though the edit window font setting is language independent.
  • In Control Panel the checkbox for Beta: Use Unicode UTF-8 for worldwide language support (Region > Administrative > Change system locale....) was not checked.
  • Unifont is an impressive font. It is bundled with NetBeans, it can render all characters in the BMP, and was the only fixed width font I could find to render Latin, Japanese and Hindi text. Though not great visually, it seems acceptable for software development requiring different character sets from multiple languages.
  • I can't vouch for the quality of the rendering of the Japanese and Hindi glyphs. See the Status section of this article for more information on Unifont, and some cautions on its limitations.
  • While not directly related to your question, you might consider moving that language specific data out of your source code and into resource files if possible.
skomisa
  • 16,436
  • 7
  • 61
  • 102