[FriBidi] log2vis() misbehaving with Arabic text?

Philip Semanchuk osvenskan at gmail.com
Mon Oct 27 08:39:24 PDT 2014


On Thu, Oct 23, 2014 at 4:28 PM, Behdad Esfahbod <behdad at behdad.org> wrote:
>
> On 14-10-23 12:35 PM, Philip Semanchuk wrote:
> > Hi Behdad,
> > Thanks very much for the informative reply. I learn something new every day,
> > including the fact that I have a lot to learn.
> >
> > I feel sure I should have a followup question but I need to experiment some
> > more before I can ask it.
> >
> > I agree with your confidence in FriBidi over BAR. The latter is great for what
> > it is, but I’m sure FriBidi sees more use and review.
>
> Thanks Philip,
>
> I also ported FriBidi's arabic shaping to Python a while ago, if that's more
> convenient:
>
>   https://github.com/behdad/pyarabicshaping

Oh thanks, that's interesting.

I'm on a project that's currently using the BAR I referenced earlier
to explicitly reshape text. However that text is being passed to
Reportlab which uses (py)fribidi.log2vis(), so the strings are being
reshaped twice. My theory is that I could remove the explicit
reshaping and let Reportlab's calls to log2vis() handle everything. If
that worked, I would be able to delete a bunch of code which is always
good news.

I need to play around with it a little, though. For instance, I saw
one case where the PDF rendered an unprintable character where
log2vis() had inserted a ZWNBSP (0xfeff) into a string. Technically a
ZWNBSP should be harmless but...

Cheers
Philip


More information about the fribidi mailing list