[HarfBuzz] Getting glyph information using Harfbuzz API
deepak.jois at gmail.com
Wed May 24 03:45:35 UTC 2017
I am using Harfbuzz to layout text using LuaTeX. As part of that, I need
to provide LuaTeX with some information about all the glyphs in the font.
Strictly speaking, this is more of a job for an Opentype parsing library
than a shaping library like Harfbuzz.
However, Khaled Hosny mentioned that I might be able to get the information
I need from Harfbuzz itself. It seems the functionality I need should be
somewhere in hb-font.h or hb-ot-layout.h I am looking at the API and it is
not immediately obvious how I can do the following things with Harfbuzz:
1. Get a list of all the glyph ids in the font
2. Get a list of character to glyph mapping, i.e. the contents of the cmap
3 I suppose if I have (1) above I can get a hb_glyph_extents_t for each
glyph. I am not sure how to convert it to a value that makes sense to
LuaTeX which requires a width, depth and height.
4. How does (3) above work for OpenType fonts with PostScript outlines
which apparently do not store the character depth and height in the file. I
know LuaTeX’s internal fontloader (based on FontForge) does some
calculations to find the bounding box for each glyph. Can Harfbuzz do that
too? Is that what this issue talks about?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the HarfBuzz