[HarfBuzz] I wonder why glyph 'uni0647' is not substituted with the one at 0xFEE9('uni06BE.fina') in Tahoma font

Graham Douglas graham.douglas at readytext.co.uk
Wed Sep 18 08:48:25 PDT 2013


On 18/09/2013 16:05, Behdad Esfahbod wrote:
> Interesting.  My biggest problem with LuaTeX always was that implementing full
> shaping is too big of a task to be done for TeX alone, in Lua.  Got links?
Hi Behdad

Nothing public at the moment. I've been discussing ideas with Khaled
Hosney and, at present, I'm exploring HarfBuzz/LuaTeX as follows:

I ported one of the most recent LuaTeX code bases to build natively
under Windows using Visual Studio and have compiled HarfBuzz as a .lib
which is also compiled into the LuaTeX executable --- just for
convenience really. At present, I am experimenting with the Lua C API
and "the best way".... to interface with HarfBuzz. Currently, I'm
exploring shaping Arabic only and have a simple interface which just
exposes the HB shaping function (my current knowledge of the HB API is
rather limited at present).

My current line of experimentation is for the HarfBuzz shaping function
to return

--- an array of what I call "shaped glyph objects" on which you can call
various methods
--- the UTF--8 encoded shaped text string if you just want to typeset it

For example (in Lua) using LuaTeX's \directlua{}

myhblib = harfbuzz.new() --- initializes a few things, returns HB
library object

local fontid = myhblib:addfont(path, LuaTeX_encoding_vector)
 --- registers a font for use with HB/FreeType, returns an ID.

At the moment I pass in the encoding vector from the LuaTeX-generated
font so that encodings match on both sides.

local str, tab = myhblib:shape("your string here", fontid)

Then the table (tab) has an set of Lua userdata "shaped glyph objects"
that represent the glyphs in the shaped string generated by HarfBuzz ---
and on which you can call methods to interrogate them for glyphid,
character, metrics, etc etc.

Not sure if it is "the right way" or will lead anywhere --- just a proof
of idea at the moment.

Best
Graham



More information about the HarfBuzz mailing list