sdk
sdk copied to clipboard
3.1-beta1-SNAPSHOT can't display chinese charset
http://chuantu.biz/t5/7/1465529422x1035372876.png
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?
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-12
so this could be, yep.
@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.
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
I have the same problem, and even I changed DarkMonkey theme to NetBeans default theme it still can't display properly.
@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.
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?
I hope the government can solve this BUG earlier.
@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.
你改错地方了,你那里改的是编辑框主题,应该改外观主题
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 ? )
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
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.
@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