summaryrefslogtreecommitdiff
path: root/texmf-dist/tex/generic/harftex/harf-base.lua
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-05-30 11:46:25 +0900
committerNorbert Preining <norbert@preining.info>2019-05-30 11:46:25 +0900
commit116e75910dd7de0682f578cae0194588286f5079 (patch)
tree19cc108cdc264f90273b85480c06b8fbaa2e5687 /texmf-dist/tex/generic/harftex/harf-base.lua
parentbed92c2e7b43679063fc2053728bb4a35b3b3b3d (diff)
add harftex
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