[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mozilla-i18n
Subject:    Re: Need help for Thai
From:       "Samphan Raruenrom" <samphan () thai ! com>
Date:       1999-07-30 17:43:42
[Download RAW message or body]

Yung-Fong Tang wrote:
> Yung-Fong Tang wrote:
> > > 3. About the ThStrShape function, I need to understand more about the \
> > > assumption- a. Can I assume max_glyph will be always enough if it is equal to \
> > > length ?
No.
> > > If not what it should be ?
2 * length

> > > b. Can I assume the return int will always equal or smaller than length ?
The return value will always <= max_glyph

> > > c. Can I point both dest and src to the same buffer if I only deal with 1 and 2 \
> > > but not 3 ?
> In other word, in the case Window Thai extension and Macintoshi Thai extension, can \
> I call tis620len = ThStrShape(tis620buffer, tis620len, tis620buffer, tis620len);
> and expect it do the right job ? (Notice that I reuse tis620buffer as dest and src \
> here)

No. Because the shaped string maybe longer than the input string.

This is due to
1) a rare combination that the vowel (sara_am) need to be splitted into two parts \
(nikhahit and sara_aa) 2) TAPIC rules for bad sequences (e.g. tone marks before \
upper/lower vowels or double upper/lower  vowels) state that the bad character must  \
be visible so a space (0x20) have to be inserted before them (zero-width characters).

Most of the time, the length of the output string will be the same as that of the \
input string except when the  input has any of the above sequence in it.

So for the function :-
    GetMaxLength(const PRUnichar * aSrc, PRInt32 aSrcLength,
        PRInt32 * aDestLength);
We could say :-
    *aDestLength = 2*aSrcLength;
Or maybe I should write a routine that scan the aSrc and return the exact length for \
its glyph string?


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic