Sonntag, 31. Juli 2011

libass 0.9.13 released

A few days ago FreeType 2.4.6 was released, which contains the new stroker code, which unfortunately crashes with libass 0.9.12 under some circumstances. I've released a new bugfix release, 0.9.13, to remedy this. Get it at Google Code!

Note: this release does not contain the recent complex text layout work. It's 0.9.12 plus bugfixes.

Donnerstag, 28. Juli 2011

libass git repo on Google Code

Google Code recently introduced Git support, and at the same time suffered from some reliability problems. Thus I've mirrored the repository at Google Code now. I will keep both repositories up to date.

Sonntag, 17. Juli 2011

New outline stroker from FreeType

FreeType recently received an update to its stroker, which supposedly fixes many rendering issues. And indeed it does! However, first I needed to fix the outline preprocessing in libass, since it wasn't very cleanly handling outline modifications. Now that this is fixed, here's a quick comparison of old vs. new stroker.

One font that has been very problematic for FreeType's stroker is Comiquita Sans. Previously, the outlines generated by the stroker were broken in pretty funny ways and this was clearly visible in the rendering:

The new stroker fixes these issues completely:

The new stroker is available in FreeType git master and will appear in the next FreeType release (2.4.6).

Dienstag, 12. Juli 2011

Vertical writing

VSFilter, pretty much the reference renderer for SSA/ASS, can make use of an obscure Windows feature, often called "@font". When a font name is prefixed with an "@" symbol, Windows switches to a pseudo-vertical writing mode for CJK. Latin characters are written as usual, but CJK characters are rotated and substituted by their vertical forms, if possible. Until now, libass wasn't able to do these substitutions, that especially means punctuation, brackets, parentheses and so on were wrong and and/or wrongly positioned.

With HarfBuzz shaping in place, it is easy to do these substitutions. The OpenType features vert and vkna are responsible for them. vert enables support for vertical writing in general (substitution of brackets, punctuation, et cetera) and vkna enables alternate forms for Kana, if available.

Here's a side-by-side comparison of some random Japanese text. On the left a rendering without substitutions, on the right with both features enabled. The Meiryo font was used.

Montag, 11. Juli 2011

HarfBuzz shaping support

Yeah, it's pretty much working now... after hunting down a few of stupid bugs. libass can now render text without all kinds of OpenType features. Here are a few samples.

Arabic text with diacritics (buggy with FriBidi's shaper).

Connected handwriting (using the Zaner-Bloser Schoolhouse font)

Automatic fractions (using the Calluna font)

Samstag, 9. Juli 2011

Simple Arabic shaping

FriBidi contains a simple Arabic shaper. This shaper is based around the fact that Unicode contains codepoints for presentational forms of many Arabic characters, for traditional reasons. This can be great, as it allows very easy and simple shaping by analyzing the text, without doing any font-specific lookups. However, more advanced shaping features are not possible.

Just now I added support for FriBidi's simple Arabic shaper to libass. The bug about Arabic support contains a test case, and this renders great now.

Work to use a "real" shaper, i.e. HarfBuzz, is already under way, of course. :)

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.