{"id":2942,"date":"2013-07-22T00:16:53","date_gmt":"2013-07-22T00:16:53","guid":{"rendered":"http:\/\/www.readytext.co.uk\/?p=2942"},"modified":"2013-11-28T08:11:38","modified_gmt":"2013-11-28T08:11:38","slug":"fun-with-xetex-colouring-arabic-glyphs","status":"publish","type":"post","link":"https:\/\/www.readytext.co.uk\/?p=2942","title":{"rendered":"Fun with XeTeX: Colouring Arabic glyphs"},"content":{"rendered":"<p><H1>Pre-processing Arabic text<\/H1><\/p>\n<p>Just a quick example of colouring Arabic glyphs via the XeTeX engine (XeLaTeX) using a pre-processor written in C (via FreeType and libotf). The glyph paths were obtained via FreeType and written out as TeX files that used XeTeX (i.e., xdvipdfmx) specials (<code>\\special{pdf: content...}<\/code>) to draw the glyphs, taking care to close paths when FreeType&#8217;s <code>FT_Outline_Decompose(...)<\/code> function emits a moveto. It is a relatively straightforward exercise to extend this to fully-shaped Arabic using a (home-grown) context-analysis\/shaping engine. I&#8217;ll post some examples and code.<\/p>\n<p><a href=\"http:\/\/readytext.co.uk\/files\/xelatextest2.pdf\">Download PDF<\/a><\/p>\n<p><iframe src=\"https:\/\/docs.google.com\/gview?url=http:\/\/readytext.co.uk\/files\/\/xelatextest2.pdf&#038;embedded=true\" style=\"width:100%; height:200px;\" frameborder=\"0\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Pre-processing Arabic text Just a quick example of colouring Arabic glyphs via the XeTeX engine (XeLaTeX) using a pre-processor written in C (via FreeType and libotf). The glyph paths were obtained via FreeType and written out as TeX files that used XeTeX (i.e., xdvipdfmx) specials (\\special{pdf: content&#8230;}) to draw the glyphs, taking care to close [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,10],"tags":[],"class_list":["post-2942","post","type-post","status-publish","format-standard","hentry","category-arabic","category-unicode"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2942"}],"version-history":[{"count":13,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2942\/revisions"}],"predecessor-version":[{"id":3217,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2942\/revisions\/3217"}],"wp:attachment":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}