On Sunday, July 22, 2012 10:37:13 AM UTC-7, Philip Brown wrote:
>
> Yeah, I figured.
> The good news is, I found a solution to get the JRE working properly in windows, so it can work as well as MacOS.
>
>
fyi, if anyone is curious as to what exactly my program is doing:
I thought I had lost the source code, which made me very sad

but I found an ooold version of it.
For the terminally curious, I've made it available at
http://www.bolthole.com/jdrill/jdrill-2.0-src.tar.gz
Warning: It was written in 1999, and in AWT
It's rather long, so for anyone interested, I'll suggest that you look at the GamePanel class (which is the main window), and specifically the (Label) MAIN_B object, which is the object that initially comes up with a Kanji char in it.
It should be noted that it does "set a font"; however, it just grabs the generic "dialog" font. Paraphrasing the code a bit:
font = new Font("dialog", 0, 24);
This gets its label string set to a value cached from a
KanjiDicLine obj, either from obj.getEnglish or obj.getKanji
The Kanji object is a regular String object, populated by an operational chain that looks something like
BufferedReader(InputStreamReader(file, "EUCJIS")).readLine
->String ->StringBuffer ->char[] -> String
(mostly in parseKDLine(). which is used to parse a line from the dictionary file "KanjiDic", a small version of which is in the source code tarfile)
So basically, it is a raw unicode string.
Which is supposed to be handled by java transparently, I thought.
I set the Label's label to be a raw unicode string, and expect it to "do the right thing".
On MacOS, it does the right thing. On windows, it doesnt, unless I do that hack.
> step 1: copy (jre)/lib/fontconfig.properties.src to fontconfig.properties
> step 2: modify the line
>
> sequence.allfonts=alphabetic/default,dingbats,symbol
>
> to be
> sequence.allfonts=alphabetic/default,dingbats,symbol,japanese
>