View previous topic :: View next topic |
Author |
Message |
noathustra Tux's lil' helper
Joined: 08 Sep 2003 Posts: 129 Location: NYC
|
Posted: Sat May 15, 2004 2:30 pm Post subject: Japanese kanji and java |
|
|
I am using blackdown 1.4.1 jdk/jre. I have installed every Japanese related font in portage. I have installed the MS mincho and MS gothic fonts. But I don't see kanji in Java applets. For example, the following website only shows me boxes: http://www.asahi-net.or.jp/~ik2r-myr/kanji/kanji1a.htm
from research on the web I guess taht I need to edit one of the font.properties files under /opt/blackdown-jdk-1.4.1/jre/lib/
I also believe that xlsfonts should show me Ricoh fonts, which correspond to the MS Japanese fonts. This doesn't happen.
People must be able to get Japanese working in Java applets. Please tell me how. |
|
Back to top |
|
|
fuqnbastard n00b
Joined: 13 Apr 2004 Posts: 46
|
Posted: Sun Sep 05, 2004 5:45 pm Post subject: still ... |
|
|
I too, cannot for the life of me get java to display kanji.
i'm using blackdown-jdk 1.4.2_rc1-r1
I installed mikachan-font, I installed the fonts wadalab-gothic.ttf and watanabe-mincho.ttf from the debian packages. I have Arial Unicode MS installed.
I tried calling the application (jgloss) like this:
Code: | java -Duser.language=ja -jar jgloss.jake |
First I got errors like this:
Code: | Warning: Cannot convert string "-watanabe-mincho-medium-r-normal--*-140-*-*-c-*-jisx0208.1983-0" to type FontStruct |
Then I modified font.properties.ja until I didn't get the error anymore (I found out the match with xfontsel)
Still I only see blocks where there should be kanji. It's a java only problem. Opera and kword, for example, display kanji just fine.[/code] |
|
Back to top |
|
|
hiroki Guru
Joined: 29 Jul 2003 Posts: 327 Location: @home in germany
|
Posted: Sun Sep 05, 2004 7:50 pm Post subject: |
|
|
hmm.. and /me is confused because he could see japanese characters in java-apps before, but now doesn't see them anymore, only boxes. maybe /me should just redo the steps in order to see japanese in java-apps. but /me does not find the "howto" he used before |
|
Back to top |
|
|
torklingberg Tux's lil' helper
Joined: 30 May 2004 Posts: 86
|
Posted: Fri Jan 28, 2005 9:52 am Post subject: |
|
|
bump |
|
Back to top |
|
|
slag n00b
Joined: 17 Feb 2005 Posts: 30
|
Posted: Mon Feb 21, 2005 8:28 pm Post subject: |
|
|
Same situation. No idea as to a solution.
I'm using the masked (very much so!) JDK 1.5 (need it for Data Structures class,) so I really didn't expect everything to work perfectly. It would be nice to fix, though. |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Tue Feb 22, 2005 11:29 am Post subject: |
|
|
There are some how-tos on the net that involve downloading another really big font (cyberbit) and modifying the font.properties.[ja] and font.dir files. I followed that tutorial, however it did not solve the problem: Now the empty boxes are gone, and there are just no chars visible instead...
The tutorial is located here, maybe one of you has more luck with it:
http://senseis.xmp.net/?AsianFontsJava
(You have to scroll down to the linux section, beginning of the tutorial is for windows and mac)
All other applications (Firefox et cetera) show japanese and alien characters just fine.
Does switching from Blackdown to Sun Java help? |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Tue Feb 22, 2005 11:43 am Post subject: |
|
|
Yay, it works!
WARNING: The following solution is considered a really bad hack:
Copy Cyberbits.ttf (download from tutorial above) to /opt/blackdown-jdk*/jre/lib/fonts/
You may use any other TTF font that supports the characters you need instead.
Execute the following:
Code: | cd /opt/blackdown-jdk*/jre/lib/fonts/
rename .ttf .ttf.old *
for f in *.old;
do
k=`echo "$f" | sed -e s/.ttf.old/.ttf/g`;
ln -s Cyberbit.ttf.old "$k";
done; |
Now all Java fonts have been renamed to .old and the old names are now symlinks that all point to the Cyberbit font. This means that Java now is forced to use Cyberbit font for everything. Things will look different now in Java (because a different font is used) but at least all characters will be displayed. No more empty boxes.
If the above doesn't work for you and you want to undo it:
Code: | cd /opt/blackdown-jdk*/jre/lib/fonts/
find -type l -exec rm \{\} \;
rename .ttf.old .ttf * |
|
|
Back to top |
|
|
|