Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #16227
| From | Philip Brown <phil@bolthole.com> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: problem with java displaying unicode, under ms-windows |
| Date | 2012-07-22 12:09 -0700 |
| Organization | http://groups.google.com |
| Message-ID | <1ccec3d0-3d93-4af0-a2ae-ecc906f2d118@googlegroups.com> (permalink) |
| References | <096d855d-7df4-4591-a498-818ae0bb193c@googlegroups.com> <juh9cu$th3$1@dont-email.me> <cc8d3ee0-d524-4e61-89db-eba746f3e878@googlegroups.com> <juhc67$djo$1@dont-email.me> <fdd94a6a-992f-4490-8768-c504ae89339b@googlegroups.com> |
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
>
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Find similar | Unroll thread
problem with java displaying unicode, under ms-windows phil@bolthole.com - 2012-07-21 22:31 -0700
Re: problem with java displaying unicode, under ms-windows Lew <noone@lewscanon.com> - 2012-07-21 23:48 -0700
Re: problem with java displaying unicode, under ms-windows Philip Brown <phil@bolthole.com> - 2012-07-22 05:00 -0700
Re: problem with java displaying unicode, under ms-windows Lew <noone@lewscanon.com> - 2012-07-22 13:15 -0700
Re: problem with java displaying unicode, under ms-windows rossum <rossum48@coldmail.com> - 2012-07-22 12:53 +0100
Re: problem with java displaying unicode, under ms-windows Philip Brown <phil@bolthole.com> - 2012-07-22 05:47 -0700
Re: problem with java displaying unicode, under ms-windows markspace <-@.> - 2012-07-22 08:46 -0700
Re: problem with java displaying unicode, under ms-windows Knute Johnson <nospam@rabbitbrush.frazmtn.com> - 2012-07-22 09:22 -0700
Re: problem with java displaying unicode, under ms-windows Philip Brown <phil@bolthole.com> - 2012-07-22 09:55 -0700
Re: problem with java displaying unicode, under ms-windows markspace <-@.> - 2012-07-22 10:10 -0700
Re: problem with java displaying unicode, under ms-windows Philip Brown <phil@bolthole.com> - 2012-07-22 10:37 -0700
Re: problem with java displaying unicode, under ms-windows markspace <-@.> - 2012-07-22 11:31 -0700
Re: problem with java displaying unicode, under ms-windows Philip Brown <phil@bolthole.com> - 2012-07-22 11:40 -0700
Re: problem with java displaying unicode, under ms-windows markspace <-@.> - 2012-07-22 11:47 -0700
Re: problem with java displaying unicode, under ms-windows Philip Brown <phil@bolthole.com> - 2012-07-22 12:09 -0700
csiph-web