Mittwoch, 6. Juli 2011

libass now supports bidi

After a rather long phase of refactoring and cleaning up libass, I finally started with the BiDi implementation, using FriBidi. This turned out to be easier than expected! Well, at least a buggy first implementation was easy. Let's see where we can go from here.

Here's a sample. Latin text with a bit of Hebrew in it that is rendered right-to-left (RTL).

for example, the Hebrew name Sarah (שרה) is spelled\Nshin (ש) resh (ר) heh (ה) from right to left.


Here's a more complex one. Hebrew text (RTL) with numbers in it (LTR) and brackets, which are mirrored by FriBidi's rather simple shaper (Later, HarfBuzz is going to do mirroring, and a lot more). Note that the dots are incorrectly positioned, that's because I'm forcing the pararaph text direction to LTR at the moment.

דייטשלאנד געהערט צו דער שענגען זאנע (אן גרענעצן) און האט אדאפטירט די איירא (די בשותפותדיקע אייראפעישע וואלוטע) אום 1999...


Directional overrides using special Unicode characters are supported, too.

Hallo wie geht?\N‮Hallo wie geht?

The code will be available in the libass repo soon. There's still some cleanup to do.

Keine Kommentare:

Kommentar veröffentlichen