sdk icon indicating copy to clipboard operation
sdk copied to clipboard

3.1-beta1-SNAPSHOT can't display chinese charset

Open LS666 opened this issue 8 years ago • 13 comments

http://chuantu.biz/t5/7/1465529422x1035372876.png

LS666 avatar Jun 10 '16 03:06 LS666

Pretty sure that's abug in Netbeans not in jme sdk. Can netbeans display them correctly? @MeFisto94 do we use a custom font that doesn't support "exotic" letters?

grizeldi avatar Jun 10 '16 06:06 grizeldi

Does it work with 3.1-alpha1 for example? Or when you change the Look and Feel in the Settings to "Platform Default, Metal, ..." or something?

DarkMonkey uses DejaVu Sans Condensed-PLAIN-12so this could be, yep.

MeFisto94 avatar Jun 11 '16 14:06 MeFisto94

@MeFisto94 I went into the same problem, it happens only when you use the Dark Monkey theme, but won't happen when you use other themes.

Jackeriss avatar Jun 14 '16 02:06 Jackeriss

http://dejavu-fonts.org/wiki/Main_Page and http://stackoverflow.com/a/18065154/6470939 show that. There is no support for those characters for these fonts.

So we could now either update the SDK to use a default font (Arial?) or comparable but we shouldn't use Font XYZ because one always has to think about license implications

MeFisto94 avatar Jun 16 '16 19:06 MeFisto94

I have the same problem, and even I changed DarkMonkey theme to NetBeans default theme it still can't display properly.

jmecn avatar Jun 23 '16 01:06 jmecn

@MeFisto94 Hi,the messy code didn't happened in code editor. It happened in menu ,toolbox and many other JME IDE's GUI. I haven't write anything. I have tried to change the theme, but it didn't work. 001

youmingfl avatar Apr 20 '17 05:04 youmingfl

Yeah, you can see on the right that the code is another font. It is strange that changing the theme did not help, since pure netbeans works correctly, right? Have you restarted the sdk after changing the theme?

MeFisto94 avatar Apr 23 '17 12:04 MeFisto94

I hope the government can solve this BUG earlier.

ModuleCode avatar Jan 18 '19 10:01 ModuleCode

@MeFisto94 Hi,the messy code didn't happened in code editor. It happened in menu ,toolbox and many other JME IDE's GUI. I haven't write anything. I have tried to change the theme, but it didn't work. 001

你改错地方了,你那里改的是编辑框主题,应该改外观主题 20190430162740

wupei93 avatar Apr 30 '19 08:04 wupei93

DarkMonkeyLookAndFeel.java forces swing window to use font as "DejaVu Sans Condensed-PLAIN-12". This causes menu displays what's called "tofu" (small boxes are shown to represent the characters because of there are no characters in the text that cannot be displayed).

https://github.com/jMonkeyEngine/sdk/blob/83726d84c91b4c6126e4d7e2544e4bdbe68d8233/jme3-dark-laf/src/org/jme3/netbeans/plaf/darkmonkey/DarkMonkeyLookAndFeel.java#L109

It's better to have fallback font ( it means , if there is no font, jme use system default font ). It's easily accomplished with checking font existence.

I can create a PR, but I can't build current JMonkey SDK master source. ( because of #231 ? )

hangingman avatar Jul 21 '20 09:07 hangingman

Are you sure that the Font is not present? I think the Font is present but it just cannot display the characters, in which case we'd need a check to see whether the font supports that language or not. Either way if you come up with a solution that works, a PR is more than welcome.

MeFisto94 avatar Jul 21 '20 13:07 MeFisto94

@MeFisto94

Are you sure that the Font is not present? I think the Font is present but it just cannot display the characters,

Yes, you're right. I misunderstood the point.

in which case we'd need a check to see whether the font supports that language or not.

I found a API, java.awt.Font#canDisplay. I'll try it.

hangingman avatar Jul 21 '20 23:07 hangingman

@MeFisto94 I created PR, would you please check it ? I simply apply DejaVu font if user locale is not CJK. https://github.com/jMonkeyEngine/sdk/pull/281

hangingman avatar Aug 08 '20 17:08 hangingman