Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Japanese kanji and java
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Languages
View previous topic :: View next topic  
Author Message
noathustra
Tux's lil' helper
Tux's lil' helper


Joined: 08 Sep 2003
Posts: 129
Location: NYC

PostPosted: Sat May 15, 2004 2:30 pm    Post subject: Japanese kanji and java Reply with quote

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
View user's profile Send private message
fuqnbastard
n00b
n00b


Joined: 13 Apr 2004
Posts: 46

PostPosted: Sun Sep 05, 2004 5:45 pm    Post subject: still ... Reply with quote

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
View user's profile Send private message
hiroki
Guru
Guru


Joined: 29 Jul 2003
Posts: 327
Location: @home in germany

PostPosted: Sun Sep 05, 2004 7:50 pm    Post subject: Reply with quote

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
View user's profile Send private message
torklingberg
Tux's lil' helper
Tux's lil' helper


Joined: 30 May 2004
Posts: 86

PostPosted: Fri Jan 28, 2005 9:52 am    Post subject: Reply with quote

bump
Back to top
View user's profile Send private message
slag
n00b
n00b


Joined: 17 Feb 2005
Posts: 30

PostPosted: Mon Feb 21, 2005 8:28 pm    Post subject: Reply with quote

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
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2447
Location: Germany

PostPosted: Tue Feb 22, 2005 11:29 am    Post subject: Reply with quote

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
View user's profile Send private message
frostschutz
Advocate
Advocate


Joined: 22 Feb 2005
Posts: 2447
Location: Germany

PostPosted: Tue Feb 22, 2005 11:43 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Languages All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum