Tech

Compiling PyFriBidi on Windows

Although I mentioned in my previous post that PyFriBidi isn’t the Swiss Army knife of Python language support, it’s still rather useful as far as RTL language support goes given the alternatives (i.e., none).  Using it, though, requires that little step called “compiling”, which turns out to be far from a bundle of joy on Windows.

I ended up compiling it using Visual Studio 2003 to keep with the cardinal rule of using the same compiler as Python itself (2.5 in my case). Given the number of bug reports for MinGW/Cygwin, I don’t think either of those would have made this any easier. Instead of having you follow 500 steps, I’m just going to refer you to a build script…

Working with Arabic in Python

Part of working for a language services company means you get very familiar with the Unicode standard. Intimately so, to the point of awkward night-after calls. Case in point: Arabic shaping. The basic gist is that, because Arabic script is cursive, the appearance of any specific character depends on how it joins to its neighbors. For the eye-dilating details, refer to Section 8.2 of the Unicode Standard 5.1.0.

One aspect of our system uses ReportLab to create PDFs in any of the languages we support. Given Middle Eastern languages are all the rave right now (I’ll let you figure out why that might be), it didn’t take long for us to hit right-to-left (RTL) languages and, in particular, Arabic. Python’s…