summaryrefslogtreecommitdiff
path: root/texmf-dist/tex/generic/harftex/harf-base.lua
diff options
context:
space:
mode:
Diffstat (limited to 'texmf-dist/tex/generic/harftex/harf-base.lua')
-rw-r--r--texmf-dist/tex/generic/harftex/harf-base.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/texmf-dist/tex/generic/harftex/harf-base.lua b/texmf-dist/tex/generic/harftex/harf-base.lua
new file mode 100644
index 00000000..4b5931fd
--- /dev/null
+++ b/texmf-dist/tex/generic/harftex/harf-base.lua
@@ -0,0 +1,12 @@
+local hb = require("luaharfbuzz")
+
+-- LuaTeX’s TFM structure indexes glyphs by character codes, so we fake it by
+-- adding the maximum possible Unicode code point to the glyph id. This way
+-- we have a simple mapping for all glyphs without interfering with any valid
+-- Unicode code point.
+--
+-- LuaTeX use the first 256 characters above maximum Unicode character for
+-- escaping raw bytes, so skip that as well.
+hb.CH_GID_PREFIX = 0x110000 + 256
+
+return hb