diff options
author | Hans Hagen <pragma@wxs.nl> | 2019-04-04 14:11:01 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2019-04-04 14:11:01 +0200 |
commit | 64f6e8fc0c6cb9254a6fe3db0b4ab31c51cf8524 (patch) | |
tree | 1b36a0b35f5b6d516d27fe817a27249d4c6d9c78 /tex/context/base/mkiv/back-lua.lua | |
parent | 70a938c4934f042face9805fc4c392c0676b11d5 (diff) | |
download | context-64f6e8fc0c6cb9254a6fe3db0b4ab31c51cf8524.tar.gz |
2019-04-04 13:38:00
Diffstat (limited to 'tex/context/base/mkiv/back-lua.lua')
-rw-r--r-- | tex/context/base/mkiv/back-lua.lua | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/back-lua.lua b/tex/context/base/mkiv/back-lua.lua new file mode 100644 index 000000000..257fda0a2 --- /dev/null +++ b/tex/context/base/mkiv/back-lua.lua @@ -0,0 +1,52 @@ +if not modules then modules = { } end modules ['back-lua'] = { + version = 1.001, + comment = "companion to lpdf-ini.mkiv", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +local buffer = { } +local b = 0 + +local function reset() + buffer = { } + b = 0 +end + +local function initialize(specification) + reset() +end + +local function finalize() +end + +local function fetch() + local saved = buffer + reset() + return saved +end + +local function flushcharacter(current, pos_h, pos_v, pod_r, font, char) + b = b + 1 ; buffer[b] = { "glyph", font, char, pos_h, pos_v, pos_r } +end + +local function flushrule(current, pos_h, pos_v, pos_r, size_h, size_v) + b = b + 1 ; buffer[b] = { "rule", size_h, size_v, pos_h, pos_v, pos_r } +end + +-- file stuff too + +drivers.install { + name = "lua", + actions = { + initialize = initialize, + finalize = finalize, + fetch = fetch, + reset = reset, + }, + flushers = { + character = flushcharacter, + rule = flushrule, + } +} |