WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: advice for building chinese lang support extension ?  (Read 7568 times)

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #15 on: December 23, 2010, 02:09:11 AM »
Greetings, Curage

Ah. thanks for the tip. I will rewrite the script and test it in a clean reboot.

As to the unicode version. I just found it in the repo and gave it a go. Unfortunately it didnt work here. The characters, symbols, etc all look the same as in the original fluff shiped with TC3.4. I also tried changing the fonts as the comment suggested. I use `wenquanyi bitmap song` so I set the last line to *-wqy-* in the conf file. But nothing happened. I also tried -*-wqy-*, nothing changed, though *-wqy-* works in urxvt.

Anyway its a good try. If the author is Janpnese, maybe he can give wenquanyi bitmap song a go. Its a CJK font, with a Japanese subset.

Offline Syun

  • Newbie
  • *
  • Posts: 17
Re: advice for building chinese lang support extension ?
« Reply #16 on: December 23, 2010, 05:58:50 AM »
Hi.
I tested fruff-unicode with 'wenquanyi bitmap song'. See my attachment.

I used Debian "xfonts-wqy_0.9.9-3.2_all.deb" package.
There is no "*-wqy-*" font described in "fonts.dir" or "fonts.alias".
Use outputs of `xlsfonts` instead.

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #17 on: December 23, 2010, 06:49:54 PM »
Hi, Syuan
Thanks for replying. You are right. -wenquanyi-* is the right mask. I don't know much about linux so please bear with me :). I tried xlsfonts. now the font is correctly installed after following this guide(http://wenq.org/index.cgi?FirstEmperor_INSTALL )
But it still is not working:
my conf
Code: [Select]
FL_FONT_SLOT_0:-wenquanyi-*
FL_FONT_SLOT_1:-*-helvetica-*
FL_FONT_SLOT_2:-*-courier-*
FL_FONT_SLOT_3:-*-times-*
FL_FONT_SLOT_4:-*-symbol-*
FL_FONT_SLOT_5:-*-lucidatypewriter-*
FL_FONT_SLOT_6:-*-courier-medium-o-normal--*
FL_FONT_SLOT_7:-*-courier-bold-o-normal--*
FL_FONT_SLOT_8:-*-times-medium-r-normal--*
FL_FONT_SLOT_9:-*-times-bold-r-normal--*
FL_FONT_SLOT_10:-*-times-medium-i-normal--*
FL_FONT_SLOT_11:-*-times-bold-i-normal--*
FL_FONT_SLOT_12:-*-symbol-*
FL_FONT_SLOT_13:-*-lucidatypewriter-medium-r-normal-sans-*
FL_FONT_SLOT_14:-*-lucidatypewriter-bold-r-normal-sans-*
FL_FONT_SLOT_15:-*-*zapf dingbats-*
my screen shot (see attachment)
Thank you for the internationalization effort.


update on IME extention:
give up starting IME daemon on demand. I cant find a proper way to set the LOCALE variales globally:
1. .install script is run as root thus restarting wBar is not safe
2. wbar is GUI program, sudo cant start it.
3. even if wbar is restarted as user, programs started by the right click menu still cant use the IME.
so give up~
user must restart x to use fcitx IME or start a console and set variables by hand.

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #18 on: December 23, 2010, 09:56:25 PM »
Issue update:

After changing the install script to insert commands into .xsession the extension totally stopped working. If I install the extension after a clean reboot, I can see the xession is correctly modified. and IME works after retarting X. But for my current installation, after updating the extension, I see no change in the .xsession after reboot. My assumption is that the modified xsession is overwritten by data restore ? Thus though it works for on-demond-install + restartiing X, it wouldn't work for onBoot install unless the new .xession is saved.

.X.d is too late for setting up global varible, .xsession can't be modified on startup. any other place that I can setup a global variable?

Offline Syun

  • Newbie
  • *
  • Posts: 17
Re: advice for building chinese lang support extension ?
« Reply #19 on: December 24, 2010, 06:51:07 AM »
@david.w
Maybe you are using TrueType font.
fltk-1.3.tcz is compiled without fontconfig(same as fltk-1.1).
Therefore you can not use TrueType font.

I made "xfonts-wqy.tcz". Download from following link. Extract it then install extension.
http://sourceforge.jp/projects/tinycore-jp/downloads/50319/xfonts-wqy.tgz/

Offline Syun

  • Newbie
  • *
  • Posts: 17
Re: advice for building chinese lang support extension ?
« Reply #20 on: December 24, 2010, 07:06:11 AM »
.X.d is too late for setting up global varible, .xsession can't be modified on startup. any other place that I can setup a global variable?

How about "/etc/profile.d/*.sh"? See /etc/profile.


Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #21 on: December 24, 2010, 09:06:26 AM »
.X.d is too late for setting up global varible, .xsession can't be modified on startup. any other place that I can setup a global variable?

How about "/etc/profile.d/*.sh"? See /etc/profile.


Hi! Syun
Thanks for the extension. It works now. I used the some font last time. I guess I failed to register the font correctly, though they are listed in xlsfonts. Maybe its the rehash command or Xorg-bin dependency causing the problem? Anyway Good work! Are you going to submit the extension? if so i will takeout the fonts from my locale collection and depened on your fonts.
The fltk toolkit seems still buggy. As you can see in the attached screen shot. the charaters shown in the left tree is correct but garbled in the right table (Most dir looks just fine, but this dirs doesnt work. Not sure why. It looks ok in gtk open file dialog though) The editor and its open file dialog doesn't work.(Looks like the editor is not covered in your current plan, right? ;-)

As to the global variable. Thanks for the suggestion, Syun. But I am still not sure what to do:

I tried placing script in /squash-root/etc/profile.d but tinycore doesnt seem to process symbolic in that folder. so I use "cp -L /etc/profile.d/_symbolink script" in install script. The script works with sudo. but when in action, the result of this script is another symbolink after reboot. How come ... :-S
Looks like I have to cp /tmp/tcloop/..=> /etc/profil.d/...

Btw, Syun. In your extension, I suspect if xset will work onBoot. since X is not started when install script is executed. Maybe .X.d looks good for yours, but there doesnt seem to be much choice left for me. Let me see, I will try to combine them all to ensure it works correctly in any case.

Really hope there is a .X.b which is executed before x start or anywhere to place gloabl varible. By then, life will be much easier for such tasks.

[removed attachment duplicates]
« Last Edit: December 24, 2010, 01:01:03 PM by ^thehatsrule^ »

Offline ^thehatsrule^

  • Administrator
  • Hero Member
  • *****
  • Posts: 1726
Re: advice for building chinese lang support extension ?
« Reply #22 on: December 24, 2010, 01:03:50 PM »
The files in /etc/profile.d need to end in ".sh", such as /etc/profile.d/test.sh

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #23 on: December 24, 2010, 08:04:17 PM »
The files in /etc/profile.d need to end in ".sh", such as /etc/profile.d/test.sh
Ah! :o How careless am I. I should have checked its 'caller'.
Thanks, thehatsrule !

Offline Syun

  • Newbie
  • *
  • Posts: 17
Re: advice for building chinese lang support extension ?
« Reply #24 on: December 25, 2010, 12:02:12 AM »
Quote
Are you going to submit the extension?

Extensions were submitted.

Quote
The fltk toolkit seems still buggy. As you can see in the attached screen shot. the charaters shown in the left tree is correct but garbled in the right table (Most dir looks just fine, but this dirs doesnt work. Not sure why. It looks ok in gtk open file dialog though) The editor and its open file dialog doesn't work.(Looks like the editor is not covered in your current plan, right? ;-)

You need to modify a value of FL_FONT_SLOT_0, FL_FONT_SLOT_1 and FL_FONT_SLOT_4.
Use my attachment.

Quote
Btw, Syun. In your extension, I suspect if xset will work onBoot. since X is not started when install script is executed. Maybe .X.d looks good for yours, but there doesnt seem to be much choice left for me. Let me see, I will try to combine them all to ensure it works correctly in any case.

Don't worry. The Xlib fonts under "/usr/lib/X11/fonts/misc" would be rehashed when the Xserver starts.

Offline Syun

  • Newbie
  • *
  • Posts: 17
Re: advice for building chinese lang support extension ?
« Reply #25 on: December 25, 2010, 12:09:54 AM »
I forgot attachment. :'(

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #26 on: December 25, 2010, 06:38:51 PM »
@Syun:
Hi Syun, glad to see you post back. I tested fcitx with dependency on your xfont extension. But there is a minor issue - all chinese text become garbled "briks". But fortunately its easy to fix :-D. After linking the fonts to /usr/share/fonts/ folder, everything back to normal now! Could you include a copy of the symbol links to wqy fonts in /usr/share/fonts into you xfonts extension ? Many thanks.


My install script still not working, though I test it with sudo, or by sudo aterm and runing the install script in the new shell. they all works fine. But when made as extension. It always fails to modify user's .xsession.
The script is only 1 line:
grep XIM $HOME/.xsession 2>nul || \
sed -i 1i[\ -n\ \$XIM \ ]\ \&\&\ .\ /etc/profile.d/XIM.sh $HOME/.xsession
I tried replacing $HOME with /home/$(cat /etc/sysconfig/tcuser) too. Nothing changed. They all works but not when installing as onDemond.
What did I miss? Forks plese help me solve this last mystery.
Thanks in advance.


edit: a shot on the garbled text
edit: install script mystery solved - wrong folder name  :'(
« Last Edit: December 26, 2010, 05:34:31 AM by david.w »

Offline Syun

  • Newbie
  • *
  • Posts: 17
Re: advice for building chinese lang support extension ?
« Reply #27 on: December 26, 2010, 06:51:22 AM »
@david.w
Quote
Could you include a copy of the symbol links to wqy fonts in /usr/share/fonts into you xfonts extension ?

I have better idea. Add font search path to /etc/fonts/local.conf.
After all, I made chinese editions of Tiny Core Linux. Try it out.
[removed, see 4 & 6]
« Last Edit: January 05, 2011, 07:51:04 PM by ^thehatsrule^ »

Offline david.w

  • Newbie
  • *
  • Posts: 38
Re: advice for building chinese lang support extension ?
« Reply #28 on: December 26, 2010, 06:21:58 PM »
Hi Syun!
Thanks, It looks very good. Nice gift   ;D
How did you get XIM in FLTK working? PS: the window manager doesnt support CJK. All CJK text in window title become letters and digits. Could you fix them?

Offline Syun

  • Newbie
  • *
  • Posts: 17
Re: advice for building chinese lang support extension ?
« Reply #29 on: December 28, 2010, 06:07:35 AM »
@david.w
Quote
How did you get XIM in FLTK working?
I looked into how to use XIM in C language. I found the API "Xutf8LookupString" for receive data from XIM. But FLTK uses "XUtf8LookupString". This API is FLTK own implementation. I think  this API was implemented to adjust difference between multibyte and utf8.  Unfortunately this function does not work in utf8 environment. Therefore I modified this API into "Xutf8LookupString". Anyway, XIM works now.

Quote
PS: the window manager doesnt support CJK. All CJK text in window title become letters and digits. Could you fix them?
Already, FIxed. Please remember "flwm_topside_unicode.tcz".