Re: Re[2]: 0.7.12 for Monday?


Subject: Re: Re[2]: 0.7.12 for Monday?
From: Vlad Harchev (hvv@hippo.ru)
Date: Wed Nov 08 2000 - 11:41:33 CST


On Wed, 8 Nov 2000, hashao wrote:

 Hi,

> Hello Vlad,
>
> On Wednesday, November 08, 2000, Vlad Harchev wrote:
>
> VH> As for CJK support - I think it would be feasible if someone will help Belcon
> VH> to finish tracing. The only thing that doesn't work yet is import of RTF (for
> VH> unknown reason). I invite CJK guys to help with this. I will post detailed
> VH> description of the problem 7 hours later cc'ing to our CJK hackers.
>
> The latest CJK patch with gdk_fontset_load did not work well for me
> (Under zh_CN.GB2312). Before loading a font, the patch tests if a font
> is_CJK_font. For non-CJKFont, it loads font with gdk_font_load.
> Otherwise, gdk_fontset_load is used by constructing a fontset from the
> given font and s_defaultNonCJKFont.
>
> The problem is that since there are no tags in a .abw file to mark
> CJKFonts, there could never be any CJKFont created at the first place.
> A default iso-8859-1 font is always used. And all available fonts in
> the style menu are iso-8859-1 ones. As the result, either CJK chars or
> Westen Europe chars are displayed by the NonCJKFont's.
>
> BTW: I have no special CJK font directory installed for abiword. I
> just installed the old abiword package from Debian potato. Compile the
> current CVS, set the environment according abiword script. And run the
> compiled binary without installation. I am not sure if that caused my
> problem. I think abiword specific font directory are for printing
> only.
>
> I think the codes:
> if(!is_CJK_font()) {
> gdkfont = gdk_font_load(newxlfd);
>
> if (!gdkfont)
> {
> free(newxlfd);
> newxlfd = myXLFD.getFallbackXLFD();
> requested_lfd = newxlfd;
> gdkfont = gdk_font_load(newxlfd);
> }
>
> should use the similar algorithm as the 'else' clause followed it to
> construct a fontset except reverse the sense of non-cjk parts and the
> cjk parts.
>
> I have tried just that. but since somehow the s_defaultCJKFont[s]
> is not initialized if I put it in the above 'if' clause, I get
> a segfault when I start the application. if I use:
> sprintf(buf,"%s,-*-*",newxlfd);
> gdkfont = gdk_fontset_load(buf);
> to replace the above gdkfont = gdk_font_load(newxlfd);
> I can view Chinese with no problem except that the Chinese
> font is out of proposition (as expected).

 AW will use only the fonts that it searches explicitly - in ${prefix}/fonts
and its subdirectories. So if you wan AW to support any Chinese fonts, you
should put them in (in your case) in subdirectory with name "GB2312" of
${prefix}/fonts/.
 Belcon Zhao told that with the patch that was committed yesterday night AW
shows GB2312 just fine (if Chinese fonts are in proper subdir). So please try
it.
 
> Anyway, I think the thing should be:
> 1. There should be someway to chose the current font face for
> different locale (You can do that in Win2k application, based on
> something MS called 'script'). Abiword use customized fontselector, so
> this should be no problem.
>
> 2. Under a CJK environment, if a font chosen is NonCJKFont, current
> CJKFont should be used together to construct a fontset. If a CJKFont
> is chosen, the current NonCJKFont should be used together to construct
> a fontset.

 Please try adding Chinese fonts properly and reporting whether this already
works or not in AW. I have an impression that there is a big chance that AW
already does this (implicitly).

> 3. Under non-CJK environment, don't use fontset. This is listed here
> because I don't know what ill effects fontset might have under some
> other locales like Hebrew, Indi, etc. Most likely it is okey to use
> fontset only.

 Yes, in ideal the use of fontsets shouldn't hurt, but in reality I had weird
problems with them in gtk apps and russian - so I try to avoid fontsets if
possible.
 Currently AW doesn't use fonts under non-CJK locale.
 
> Please consider this or help me to set up my environment correctly.

 I would like to hlp you to setup your environment.
 You have to set $LANG to full name of your locale with charset included -
e.g. zh_CN.GB2312 Wrapper that calls AW uses charset from $LANG to add
locale-specific fonts to fontpath (or the fonts already should be in fontpath
before starting AW). Then add GB2312 Type1 fonts to subdir with name GB2312 of
${prefix}/fonts
 Everything should work then.

 Also you can contact Belcon if you have any troubles - he is using GB2312.

> PS: I found that the encoding for CJK is decided by the current
> LANG environment. I hope this can be changed to depend on LC_CTYPE.
> LANG also set a lot of other locale properties which might not be what
> a user want. Sometime, a user might want to use a English menu but
> also want to edit a Chinese document. This is not feasible with the
> current abiword.

 I believe that user has to set $LC_MESSAGES=en rather than tweak $LANG.
 Anyway - AW uses a wrapper, so it would be easy to tweak it.

> And is there an command line option for 'make' to stop building
> static binary for me? I don't care about a static binary when testing cvs.
 
 The hackish way : edit /src/config/platforms/linux.mk and comment
UNIX_CAN_BUILD_STATIC=1
  there.
 Proper way (not tested):
 Use following commandline
         make UNIX_CAN_BUILD_STATIC=0

> It takes time. Also the 'make -j 4' will not compile successfully. I
> do have a due celeron machine. :)

 Currently something weird with RTF importer under CJK locales. Very simple
code doesn't work as expected, and Belcon is trying to solve the puzzle of why
it doesn't work for a week. I will post a message describing a problem and
ways of tracing separatelty. Please help with this - it should be easy.

> --
> Best regards,
> hashao mailto:hashao@china.com.n.s.pam
>
>

 Best regards,
  -Vlad



This archive was generated by hypermail 2b25 : Wed Nov 08 2000 - 12:32:03 CST