Re: CJK patch test error report!


Subject: Re: CJK patch test error report!
From: Vlad Harchev (hvv@hippo.ru)
Date: Mon Oct 30 2000 - 12:53:37 CST


On Mon, 30 Oct 2000, Belcon wrote:

 Hi,

> Hello:
>
> I am very sorry if I had mailed this mail twice.
> I had mailed this letter,but I see nothing on
> http://www.abisource.org/mailinglists/abiword-dev/00/October/
> ,and no one seemed to see my letter.So I decided to send
> again.
 
 Hmm, it's very strange if you are subscribed to the list. If you haven't yet,
please subscribe.

> Vlad Harchev дµÀ¡Ã
> >
> > On Mon, 30 Oct 2000, Belcon wrote:
> >
> > Hi Belcon,
> >
> > > Hello
> > >
> > > After I installed the AbiWord,I started it without any parameter.
> > > And I got a error message like
> > >
> > > AbiWord could not load the following font from the X Window system
> > > display server:
> > > [-*-Times New Roman-regular-r-*-*-*-0-*-*-*-*-*-*]
> > > [deleted]
> > > ...
> >
> >
> > I remember fixing this. This problem arises due to (as I remember) bug in
> > AbiWord wrapper script. It's not yet updated to the scheme AW looks fonts in.
> > I will post a patch later this day.
> > For now, just add directories with fonts to fontpath manually after startign
> > X server, e.g.
> >
> > xset fp+ dir1
> > xset fp+ dir2
> >
>
> It works.Sorry for my stupid question.
>
> Here is my GB2312&Big5 test report:
>
> In GB2312:
> Work fine:
> * Menu & Dlg messages show fine;

 OK.

> * We can input Chinese(GB2312) in 'Find','Replace' Dialog box;

 These are GTK widgets so they should work anyway. I would be very surprised
if they didn't work.

> * We can show English letters fine.
> problem:
> * We still can't see any Chinese(GB2312) characters(unvisible) in frame;
> If we open a GB2312 abw file,it just show blank letters(it is
> two ASCII letters width)where it should show GB2312 characters.
> If we select these Chinese characters although we can't see
> them,and then select Menu item 'Find',and we will see Chinese
> characters shown in box quite well.

 Could you please elaboraye - in which box - in input entry or the characters
when highlighted in the document?
  Does it measure the width of Ch chars correctly (i.e. if you type English
char, then Ch char, then English char - can Ch char fit between the English
ones or not)?

> I still don't know why.But I guess if we install AbiWord in
> a pure GB2312 Chinese Linux distribution,AbiWord will show
> GB2312 characters fine.:-(

 Could you please try this?
 Also, can it be so that you fonts you are trying to use with AW are broken?
 Can you use these fonts in other apps? Are they indeed Type1 fonts?

> * We can't input Chinese characters in Frame.(This is easy to
> fix.)

 What are your ideas on fixing input of CJK chars? Have you tried them?
 
> In Big5:
> Work fine:
> * Same as GB2312
> * Show Big5 Chinese characters quit well.

 Quite well where - in the document?
 Are there any flaws?

> problem:
> * We can't input Chinese character in Frame.(This is easy to
> fix.)
>
> Maybe I will try Japanese and Korean,but not now.

* What is your $LANG is set to?
* In which subdirectory did you place chinese fonts (did AW loaded them at
 all? - are CJK fonts available in font selection combobox)?
* Does your iconv knows your charset (seems so, otherwise you won't see Ch
 chars in GUI elements such as menu)?
* What iconv implementation do you use (the one in glibc or standalone from
  libiconv?).
* Could you paste Ch chars from other apps? Could you import .txt files into
   AW?
* Could you save Ch chars as .txt or copy them to other documents
* Could you print correctly in Big5?

>
> BTW:
> Even I applied next-cjk.patch,I could see nothing
> if my abw file contains GB2312 characters.

 That's expected. That patch fixes completely different things.
 
 Could you please post a "boot log" of AbiWord? (It will be produced by AW
when it starts if it's compiled with debug enabled - and it can sched some
light on why it misbehaves).

 Thank you very much for this testing. Your help is very appreciated.

-------------------
 Here is quick hacking quide to AW:

 AW draws characters on the screen in the function
/src/af/gr/unix/gr_UnixGraphics.cpp:GR_UnixGraphics::drawChar{s}(...)
 After the expanded body of the macro CONVERT_TO_MBS gets executed, buffer
with name 'text' should contain the conversion of the UCS-2 char to current
encoding. The conversion is done in function
        UT_Wctomb::wctomb_or_fallback
so you can set a breakpoint on to debug it. (just type
        'b UT_Wctomb::wctomb_or_fallback'
in gdb to set a breakpoint). That function in turn uses iconv to perform
translation. Please explore whether it performs valid conversion.

 Input is done in
    src/af/ev/unix/ev_UnixKeyboard.cpp:ev_UnixKeyboard::keyPressEvent
 In the 'else' branch of 1st if, 'e->string' should contain a just-types valid
sequence in current encoding (BWT I don't reset a shift state neither on
input from keyboard nor on output - so if it's required, this may be a
reason of all problems). Could you please explore and say whether 'e->string'
contains a valid string. Also, somewhat below there is a code:

                case EV_EEMR_COMPLETE:
                        UT_ASSERT(pEM);

                        uLength=0;
                        ucs=new UT_UCSChar[mLength];
                        for(int i=0;i<mLength;++i)
                          {
                                if(m.mbtowc(wc,mbs[i]))
                                  ucs[uLength++]=wc;
                          }
                        invokeKeyboardMethod(pView,pEM,ucs,uLength); //no char

                        delete ucs;
                        return UT_TRUE;

 Does 'ucs' contain a correctly translated characters?

 As for printing - see
        src/af/xap/unix/xap_UnixPSGraphics.cpp:PS_Graphics::drawChars
 to see how .ps file is generated (how CJK and non-CJK characters are
 emitted).

>
> Best regards!
>
> Belcon
>
>
> > Fontpath should include fonts listsed in ${prefix}/fonts and
> > ${prefix}/fonts/DIRECTORY_WITH_CJK_FONTS
> > for AW to work.
> >
> > Please report any problems any bug you find.
> >
> > > And it suggested me to look
> > > http://www.abisource.com/mailinglist/abi-dev/00/September/0240.html
> > > I read it and found that my XFree86 is 3.3.6.Even if I do as it
> > > said,AbiWord
> > > doesn't work at all.
> > > I don't know why.When I install AbiWord 0.7.10,I haven't got this
> > > problem.
> > >
> > > Best regards!
> > >
> > > Belcon
> > >
> >
> > Best regards,
> > -Vlad
>

 Best regards,
  -Vlad



This archive was generated by hypermail 2b25 : Mon Oct 30 2000 - 13:16:36 CST