{"id":2920,"date":"2013-07-13T11:59:44","date_gmt":"2013-07-13T11:59:44","guid":{"rendered":"http:\/\/www.readytext.co.uk\/?p=2920"},"modified":"2013-11-28T08:12:03","modified_gmt":"2013-11-28T08:12:03","slug":"creating-a-clock-with-arabic-digits-using-the-cairo-graphics-library","status":"publish","type":"post","link":"https:\/\/www.readytext.co.uk\/?p=2920","title":{"rendered":"Creating a clock with Arabic digits using the Cairo graphics library"},"content":{"rendered":"<h1>Cairo graphics<\/h1>\n<p>Cairo is an excellent <a href=\"http:\/\/www.cairographics.org\/\">graphics library<\/a>, albeit a little tricky to build on Windows. After successfully compiling it as a static library (.lib) I wanted to explore using it to create PDFs containing Arabic. Cairo is a graphics engine, not a text layout engine, so with complex scripts like Arabic you need to take care of the shaping and text placement yourself. Naturally, this is pretty fiddly but it&#8217;s certainly quite possible. So, here are a couple of clocks as examples &ndash; note that the positioning of the numbers is not quite perfect so I have a little tweaking to do on that. Additionally, the resulting PDF imports nicely into the latest XeTeX engine. For the digits I used the font ScheherazadeRegOT, <a href=\"http:\/\/scripts.sil.org\/cms\/scripts\/page.php?site_id=nrsi&#038;id=arabicfonts\">available from SIL<\/a>.<\/p>\n<p><a href=\"http:\/\/readytext.co.uk\/files\/pdfclock.pdf\">Download PDF<\/a><\/p>\n<p><iframe src=\"https:\/\/docs.google.com\/gview?url=http:\/\/readytext.co.uk\/files\/\/pdfclock.pdf&#038;embedded=true\" style=\"width:100%; height:600px;\" frameborder=\"0\"><\/iframe><\/p>\n<p><a href=\"http:\/\/readytext.co.uk\/files\/pdfclock1.pdf\">Download PDF<\/a><\/p>\n<p><iframe src=\"https:\/\/docs.google.com\/gview?url=http:\/\/readytext.co.uk\/files\/\/pdfclock1.pdf&#038;embedded=true\" style=\"width:100%; height:600px;\" frameborder=\"0\"><\/iframe><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Cairo graphics Cairo is an excellent graphics library, albeit a little tricky to build on Windows. After successfully compiling it as a static library (.lib) I wanted to explore using it to create PDFs containing Arabic. Cairo is a graphics engine, not a text layout engine, so with complex scripts like Arabic you need to [&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,24,16],"tags":[],"class_list":["post-2920","post","type-post","status-publish","format-standard","hentry","category-arabic","category-pdf-technical","category-typesetting-and-algorithms"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2920","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=2920"}],"version-history":[{"count":9,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2920\/revisions"}],"predecessor-version":[{"id":3219,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=\/wp\/v2\/posts\/2920\/revisions\/3219"}],"wp:attachment":[{"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2920"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2920"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.readytext.co.uk\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2920"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}