Enable to display CJK characters for sdk v3.2#281
Conversation
MeFisto94
left a comment
There was a problem hiding this comment.
So the main change is okay, but the gradle changes need to be reverted. I know it didn't compile because of the removal of jogl, but it changes a lot of things that we don't want and also makes it even more platform dependant. I've marked the two changes we could keep for the build.gradle, but they aren't really necessary.
| * DejaVu doesn't support CJK glyphs | ||
| * @return true if user locale is "ja" or "ko" or "zh" | ||
| */ | ||
| private Boolean userLangIsCJK() { |
There was a problem hiding this comment.
How is this for glyphs from thailand or india, I guess they would have similar problems?
There was a problem hiding this comment.
Maybe so.
If so, I started to think it's better to find the list of what language is supported or not.
I will research what language is curretly supported by DejaVu fonts 2.34.
There was a problem hiding this comment.
I found list of supported language code.
https://github.com/dejavu-fonts/dejavu-fonts/blob/version_2_34/dejavu-fonts/langcover.txt
There was a problem hiding this comment.
I have created a list with property file with using this langcover.txt.
| // >zh-sg Chinese in Singapore 0% (2/6765) 0% (2/6765) 0% (2/6765) | ||
| // >zh-tw Chinese (traditional) (0/13063) (0/13063) (0/13063) | ||
| String lang = System.getProperty("user.language"); | ||
| return lang.matches("ja|ko|zh"); |
There was a problem hiding this comment.
Is something like startsWith required for Chinese or maybe ^zh-.*$ or something?
There was a problem hiding this comment.
I don't think so. Because the language code and country code is different property.
For example my default java language code and country code setting are
-Duser.language=ja -Duser.country=jp
UI should follow user's property of user.language.
There was a problem hiding this comment.
I changed my mind, there are some minor patterns (can't detect supported or not by only language code).
It looks good to detect with both language code and country code.
mn-cn Mongolian in China (0/130) (0/130) (0/130)
mn-mn Mongolian in Mongolia 100% (70/70) 100% (70/70) 100% (70/70)
|
@MeFisto94 Hi, |
MeFisto94
left a comment
There was a problem hiding this comment.
Sorry, looks like I forgot to submit my review :/
Regarding the files I am not sure what the best approach would be, though, e.g. instead of awk having a gradle task auto-generate the file so it does not need to be in the repo? or not have that because the source file langcover.txt would never change.
Talking of langcover, does it have any license issues we should be aware of?
| url "http://jcenter.bintray.com/" | ||
| } | ||
| jcenter() | ||
| mavenCentral() |
There was a problem hiding this comment.
Why is there mavenCentral though?
| @@ -0,0 +1,18 @@ | |||
| #!/bin/bash | |||
There was a problem hiding this comment.
I am still not sure about the existence of this, gradle's buildSdk task should take care of that in a better (version- and platform independent manner).
There was a problem hiding this comment.
I update build.gradle to copy jar files from engine directory, and removed shell script.
* Add nifty-gui as dependencies * Apply DejaVu font if user locale is not supported * https://stackoverflow.com/a/18065154/2565527 * Add lang.properties to check DejaVu supporting tha language or not * Copy dependency jme3 jar files with gradle
|
@MeFisto94 Hi,
I think langcover.txt may not be changed in the future, so removed.
I added copyEngineLibs task in the build.gradle. This task copy dependency jar files. And described detailed description on issue top. |
| } | ||
| } | ||
|
|
||
| def copyEngineJarsToLib(file, extraJars=["nifty"]) { |
There was a problem hiding this comment.
I still don't gather why you try to copy the files from the engine folder, where the idea is to use gradles dependency resolution?
Also why do you depend on nifty-gui through jitpack while we get it transitively through
Line 99 in 36d11b6
There was a problem hiding this comment.
@MeFisto94
Because, in my understanding, the buildSdk task need to have dependency jars but there are no process to download or copy these jar files. Probably since that reason, on my local environment after executing buildSdk will cause gradle error "Could not find org.jmonkeyengine:jme3-*".
I'm afraid current build script don't resolve dependency jars (jme3-.jar) correctly. build_engine.sh generates many jme3-.jar files, but it don't copy files into /lib directory or maven local repository.
So, I modified build.gradle script. Is there any misunderstanding for my side ?
There was a problem hiding this comment.
That's definitely a misunderstanding, because CI works (https://travis-ci.org/github/jMonkeyEngine/sdk/jobs/724436054).
If that error was about a specific jme3-jogl, that's fixed in 56cdc94, essentially: Your engine folder needs to be on 3.3 (checkout or delete it and let the scripts work).
Due to
Line 2 in 36d11b6
Line 167 in 36d11b6
So all in all, it should work. Sorry for being not clear enough about this in the beginning, so you had that extra work
|
Close PR, and will reopen after fixed. |
fix #73
Whats' this PR do ?
Problem
DarkMonkeyLookAndFeel.javaforces swing window to use font as "DejaVu Sans Condensed-PLAIN-12".Solution
Main modification
DarkMonkeyLookAndFeel.java, apply DejaVu font if it supports glyphs for current user's locale and countryGradle
Add a new task
copyEngineLibsthat copy dependency jar files under./enginedirectory intolibdirectory.corelibs, optlibs, testdatalibs, examplelibsjar files name starting withjme3-, and renaming.com.github.nifty-gui:nifty:1.4.2jar will be copied.Remove
dependencies.resolve()linescopyEngineLibsinstead ofdependencies.resolve()