XeTeX ported to HarfBuzz (and more)

XeTeX is an modern extension of TeX typesetting engine that supports Unicode, modern font technologies (OpenType and Graphite, plus AAT on Mac OS X) and many other goodies for multilingual and complex script typesetting.

XeTeX was written and maintained by Jonathan Kew, but lately he had less time for maintaining it. Last year I started to partially maintain XeTeX, supported by TUG, originally intending to mainly look after issues in OpenType math support, and my first release was 0.9998 (for TeX Live 2012) with fixes to some long standing OpenType math issues.

Late last year, after giving up on my attempt to port LibreOffice to HarfBuzz, I decided to port XeTeX instead. Both LibreOffice (and OpenOffice before it) and XeTeX were using the ICU LayoutEngine library to do OpenType layout, but it is no longer being maintained for quite sometime now, with bugs and even regressions left unfixed, not to mention support for new features. XeTeX was even used a locally patched version of it to handle many features not supported upstream. HarfBuzz, on the other hand, is an actively maintained, feature rich library with a versatile API and a very cooperative developers (I got at least a couple new API calls for my XeTeX needs, not to mention regular bug fixes), and is used by many high profile free software projects (though it lacks documentation, but hey, who needs documentation, one can always read the code or ask on the mailing list :)). The HarfBuzz port went smooth and in a few weeks we had a new version of XeTeX no longer using a patched ICU library (we still use ICU for other stuff like input encodings, bidirectional algorithm and locale sensetive line breaking), followed by a few months of bug fixes, re-factoring and code removal, so we ended up with more functionality and less code (yay).

XeTeX also supports Graphite font technology, but it was using the first generation Graphite engine, but in the meantime a new faster and more robust engine has been developed. While working on the HarfBuzz port, Martin Hosken (Graphite developer) approached me about upgrading XeTeX to the new library, and since HarfBuzz already have a Graphite2 backend I found it would be easier to use it, so I did just that, and ported our other uses of the old Graphite API (line breaking, querying font features etc.) to directly use the new Graphite2 API, with big help from Martin and other Graphite hackers.

Few months earlier to all this, Jiang Jiang started porting XeTeX on Mac from the long deprecated ATS/ATSUI font APIs (which Apple didn’t even provide on their 64-bit systems) to the new Core Text ones, and I kept bothering him asking when the port will be finished so he finished it, probably just to get rid of me. Since I didn’t have a Mac machine (not being a fan of Apple), I couldn’t do much work on the Mac code except remotely which boiled down to just making sure that XeTeX keeps building on Mac. After knowing about the long awaited Core Text port, TUG offered to buy me a Mac machine through the MacTeX fund so that I can maintain XeTeX on Mac, I wasn’t very enthusiastic about idea at the beginning (naturally), but after all XeTeX started on Mac and has a large user base there and, like it or not, I have to support them, so I sold out and acquired a so-called “MacBook Pro” laptop with a so-called “Retina” display (which I’m not using to write this blog post).

So at last I have a TeX engine that can showcase all features of Amiri font (time to find something serious to typeset).

So this week a beta version of XeTeX 0.99991 series have been released including the HarfBuzz, Graphite2 and Core Text ports and many other bug fixes (check the release notes).

Sources can be downloaded from SourceForge page, users of TeX Live can install binaries for several platforms from TLContrib repository, and final versions should be included in the upcoming TeX Live 2013 release.


  1. XeTeX version numbers are asymptotic to 1 (just like TeX version numbers being asymptotic to π), so the next stable version will not be 1.0 but rather 0.99991 :) 

إصدارة جديدة من الخط الأميري

إصدارة أخيرة من الخط الأميري قبل نهاية عام ٢٠١٢ :). تشتمل هذه الإصدارة على الكثير من التحسينات على تموضع التشكيل، و التآلف، و أشكال الحروف، إلى آخره من التحسينات المعتادة. و يمكن تنزيلها من المكان المعتاد.

لكن أهم ما في هذه الإصدارة هو إضافة خط جديد إلى المجموعة، ”أميري قرآن“؛ خط منفصل لتنضيد النصوص القرآنية، و هو فرع من خط أميري العادي مع بعض الإعدادات و الخصائص المبدئية المُطوعة لتناسب تنضيد النص القرآني لكن لا تناسب النصوص العادية. فمثلا ارتفاع السطر أكبر من الخط العادي ليستوعب علامات الوقف، و الهمزة على واو أو ياء إذا كانت مكسورة تأتي تحتهما، و بعض التراكيب التي يتداخل فيها التشكيل عندما تُشكّل كل الحروف أزيلت. و لتقليل حجم الخط (مفيد عند استخدامه عبر الوب) أزيلت أي محارف غير مستخدمة في النصوص القرآنية.

Amiri font v0.103

A new bug fix release of Amiri font. Release note: English, Arabic.

الخط الأميري ٠٫١٠٢

إصدارة جديدة من الخط الأميري:

Amiri font v0.102

Another Amiri font release:

Amiri font v0.101

Another Amiri font release in less than month (release early, release often ;). The main feature of this release is brand new bold and bold slanted fonts, so now we cover the four common styles, though more work on polishing them still needed. Check News file for more detailed changes of this release (Arabic, English)

الخط الأميري ٠٫١٠٠

إصدارة جديدة من الخط الأميري مع قفزة جديدة في رقم الإصدارة لتوضيح الانتقال من مرحلة ألفا إلى مرحلة بيتا :) (أرقام إصداراتي لامنطقية، لكن هكذا الحياة).

Amiri font v0.100

Yet another Amiri font release with yet another jump in version number, this time to mark the move from alpha stage to beta stage :) (my versioning scheme makes no sense, but so is life).

الخط الأميري ٠٫٠١٦

إصدارة جديدة أخرى من الخط الأميري، هذه المرة مع دعم مكتمل -نوعا- ما للرسم القرآني، وهي آخر ميزة مهمة كانت تنقص الخط، وربما بعد إصدارتين أو أقل يدخل الخط إلى مرحلة بيتا تمهيدا للإصدارة النهائية.

أول سورة البقرة

Amiri font v0.016

Yet another developmental release of Amiri font, this time featuring a, more or less, complete Quranic support, which fixes the last major issue with the font, and I think it is only a couple of more alpha releases before it is ready to enter beta stage.

The start of Baqara chapter

لَقِّم المحتوى