Shapers included in the TeX Live builds of LuaHBTeX

Bruno Voisin bvoisin at icloud.com
Fri Aug 2 20:57:22 CEST 2024


Hi Marcel,

Many thanks for your patient explanations.

> As the error help text says, there are two possible reasons for
> `Shaper failed`: The shaper is not included or the shaper does not
> support the font.

First I couldn't figure out what you meant by "error help text", then I realized: it's the help message that is displayed in the tex console (for me, the TeXShop console) when you press "h" after typesetting stops. I never think of doing this, generally I just press Return to go on compiling, or "s" to enter scrollmode, then I go back to the source to try and figure out what's wrong.

Indeed, when you do the above you get

? h
You asked me to use shaper "coretext_aat" to shape
the font "file:AwamiNastaliq-Regular.ttf:mode=harf;shaper=coretext_aat"
but the shaper failed. This probably means that either the shaper is not
available or the font is not compatible.
Maybe you should try the default shaper instead?

This not only tells the possible cause of the error (I had no idea shapers only supported certain fonts) but also what triggered the error: the coretext_aat shaper. This is very helpful. I'll press "h" more!

> Create a file get_shapers.lua with content
> 
> ```
> print("Shapers: " .. table.concat({luaharfbuzz.shapers()}, ', '))
> ```
> 
> and then run `lualatex get_shapers.lua`.
> On Linux this shows `Shapers: graphite2, ot, fallback`

Exactly the same on the Mac (and Windows, based on Philip's message):

% lualatex get_shapers.lua
Shapers: graphite2, ot, fallback

> For `coretext_aat` the shaper is not included. `coretext_aat` has been
> removed from HarfBuzz more than 5 years ago, so there is nothing to
> install.
> 
> The `graphite2` shaper should usually be included in TeX Live builds (I
> didn't check Mac, but it would be odd if it would be missing there) but
> you still need a Graphite2 font. Unless your font is Graphite enabled
> the shaper will fail.
> 
> Beside that: You should almost never explicitly set the shaper. The
> default (fontspec option `Renderer = HarfBuzz`) will automatically
> use graphite2 if it's supported by the font and otherwise use `ot`.
> The `ot` shaper also implements AAT and will automatically use AAT
> feature when used with an appropriate font.

Just when your message arrived I was putting together test files based on the example on p. 14 of the luaotfload doc. The (plain TeX) files are attached. They assume AwamiNastaliq-Regular.ttf from Awami Nastaliq <https://software.sil.org/awami/download/> is present in the current directory.

The files test the shapers for LuaHBTeX (no explicit shaper vs fallback vs ot vs graphite2 vs coretext_att), and similarly the renderers for XeTeX (no explicit renderer vs /OT vs /GR vs /AAT).

The conclusions are totally consistent with your description: 


- LuaHBTeX

no explicit shaper: same result as graphite2

fallback: result similar to ot in the luaotfload doc (with slight variations in the placement of "accents" -- if that is the proper term, I don't know Arabic)

ot: result identical to ot in the luaotfload doc (with other slight variations)

graphite2: result identical to graphite2 in the luaotfload doc (with slight variations)

coretext_aat: error, then switch to fallback when scrollmode is entered


- XeTeX

no explicit renderer: same result as fallback for LuaHBTeX

/OT: same as fallback

/GR: same as graphite2 for LuaHBTeX (with slight variations)

/AAT: same as fallback


Finally: this all started because I was trying to create font samples and prevent any ligature in the samples. I thought maybe one of the available shapers would produce that. Then I realized a better way of proceeding would be to insert zero-width joiners U+200D between the characters in the samples.

Thanks again,

Bruno

-------------- next part --------------
A non-text attachment was scrubbed...
Name: shaper-test-luahbtex.pdf
Type: application/pdf
Size: 26479 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-live/attachments/20240802/3bc2cee9/attachment-0002.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shaper-test-luahbtex.tex
Type: application/octet-stream
Size: 931 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-live/attachments/20240802/3bc2cee9/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shaper-test-xetex.pdf
Type: application/pdf
Size: 11614 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-live/attachments/20240802/3bc2cee9/attachment-0003.pdf>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: shaper-test-xetex.tex
Type: application/octet-stream
Size: 660 bytes
Desc: not available
URL: <https://tug.org/pipermail/tex-live/attachments/20240802/3bc2cee9/attachment-0003.obj>
-------------- next part --------------




More information about the tex-live mailing list.