Skip to content

Comparing the modes

David Carlisle edited this page Oct 3, 2024 · 3 revisions

luaotfload shaping modes

luaotfload supports three modes for fonts which can be selected through the mode pseudo fontfeature. This page is intended to collect information about advantages and disadvantages in order to help people choose a mode and in the longer term become part of the regular luaotfload documentation.

The modes

There are three modes:

  • node: This is the default mode, based on the ConTeXt fontloader. It is implemented completely in Lua and highly customizable. It supports most OpenType features.
  • base: A special mode with limited shaping support which tries to map OpenType features to native TeX ligatures and kerning. In some places only base fonts are supported, especially for fonts in math mode. Aside from these cases this mode should never be used. This is also based on the ConTeXt fontloader.
  • harf: A luaotfload addition based on HarfBuzz, a popular shaping library. By using a commonly used shaping library it has usually excellent font support, but is less optimized for TeX workflows than the other modes.

Comparision / Which to choose

We will only compare node and harf since base should never be used where the others are a option.

Generally the modes have very different implementations and even if both implement the same feature the details might vary. You should never depend on both modes providing identical output.

node harf
Speed Relatively slow, especially the first time a big font is loaded Usually faster, especially for big fonts
Hyphenation Only loses hyphenation opportunities if necessary Tends to drop relatively many hyphenation point leading to worse linebreaking.
Font support Sometimes problematic, especially for languages and scripts less commonly used with TeX. If you encounter an issue, please report a issue. Very good
Variable fonts Supported Supported

General recommendations

to be added

Questions

  • Add your questions here