Funky effects with Arabic words

This post covers applying “funky effects” to whole Arabic words – extending the work noted in my previous posts. It was was quite tricky to join a sequence of letters to form whole Arabic words as a single outline path, but I finally got there. This does not yet include positioning vowels according to OpenType mark-to-base rules in the font… that’s next on the list. Code is written in C++ with various classes defined to perform specific tasks (such as write PDF files).

Download PDF

Funky effects with Arabic glyphs!

Over the last few evenings I’ve been exploring Bézier curves and effects that can be achieved through “flattening” glyph paths. I found a great C++ library called Clipper which lets you perform a number of interesting operations on polygons. After you flatten a glyph path you can pass it to Clipper to do all sorts of “funky” things, such as offsetting the Laam-Alef glyph path in the example shown below. The PDF file was generated by the HARU PDF library (written in C) and glyph outlines were obtained using FreeType (also written in C). Well, it’s more interesting than watching the rubbish on TV!

Download PDF

Quick update: Another example with multiple paths in the glyph.

Download PDF

Typesetting Arabic clocks with LuaTeX

Just a short post to share an example of producing clock faces with Arabic numbers using LuaTeX’s nodes and glue. No drawing packages were used, all done with pdf_literal nodes and some basic trigonometry to calculate positions of the numbers, angles for clock hands and values of glue to move things around. I will try to write-up the code/techniques in a future post.

Download PDF

More progress with HarfBuzz/LuaTeX (update)

Just a short post to share another example from my on-going work on HarfBuzz/LuaTeX. A rather pointless example – without using any code to correctly place mark glyphs (e.g., vowels) – showing randomly coloured Arabic glyphs. Thanks to the power of HarfBuzz and the superb Lua C API (especially C closures and “for loop” iterators) the code to process the Arabic text is about 25 lines of Lua script.

Source of text for typesetting example: BBC Arabic. I don’t know what the text says but Google Translate indicated it was neither controversial or offensive – I hope that is the case!

Download PDF

Update

Just to add an example with mark glyph positioning and random colours. Vowel positioning added about 10 lines of Lua script :-).

Download PDF

Early results of integrating HarfBuzz into LuaTeX

Building on the work of porting LuaTeX to build on Windows I decided to explore adding HarfBuzz to provide Arabic shaping. The excellent HarfBuzz API lends itself to some interesting solutions so here’s a quick post to show some early results.

Source of text for typesetting fully vowelled Arabic examples: http://en.wikipedia.org/wiki/Arabic_language#Studying_Arabic

Download PDF