[Fribidi-discuss] Re: BiDi WINE status and fribidi
Dov Grobgeld
dov at imagic.weizmann.ac.il
Sun Aug 25 12:46:02 EST 2002
On Sun, Aug 25, 2002 at 11:25:52AM +0430, Behdad Esfahbod wrote:
> You are a little wrong Dov, we are assuming
> sizeof (FriBidiChar) == 4, at least the compiler is assuming this
> when compiling, so its quite easy in compile time, but not so
> easy in run-time. I prefer not to support it in run-time.
The number of places that FriBidiChar's are used is quite small
and it would be possible to do an outer if for supporting different
character encodings. I.e. I'm suggesting that we do:
if (fribidienv->encoding == FRIBIDI_UCS4)
{
for (i = 0; i < len; i++)
char_type[i] = fribidi_get_type (fribidienv, str[i]);
}
else if (fribidienv->encoding ==FRIBIDI_UTF8)
{
utf8_iterator it8;
for (it8 = str; it8; it8 = utf8_next(it8))
char_type[i++] fribidi_get_type(utf8_char(it8));
}
else if (fribidienv->encoding == FRIBIDI_UTF16)
{
:
}
In such a case the only overhead for UCS4 is the additional if statements.
Of course we can ifdef these away for some tight ports, but for a shared
library on a desktop computer, I believe the overhead i negligable.
Or did I miss something?
Regards,
Dov
> Behdad Esfahbod 3 Shahrivar 1381, 2002 Aug 25
> http://behdad.org/ [Finger for Geek Code]
>
> #define is_persian_leap(y) ((((y)-474)%2820+2820)%2820*31%128<31)
>
More information about the FriBidi
mailing list