summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua b/Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua
index 9e789a72fe8..ac17a9381f1 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/cldf-bas.lua
@@ -34,6 +34,8 @@ local ctxcore = context.core
local variables = interfaces.variables
local ctx_flushnode = context.nuts.flush
+local ctx_sprint = context.sprint
+local txtcatcodes = tex.txtcatcodes
local nuts = nodes.nuts
local tonode = nuts.tonode
@@ -47,6 +49,8 @@ local setattrlist = nuts.setattrlist
local texgetcount = tex.getcount
local texsetcount = tex.setcount
+local is_letter = characters.is_letter
+
-- a set of basic fast ones
function context.setfontid(n)
@@ -72,6 +76,14 @@ function context.char(k) -- used as escape too, so don't change to utf
end
end
+function context.safechar(c)
+ if characters.is_letter[c] then -- not yet loaded
+ ctx_sprint(c)
+ else
+ ctx_sprint(txtcatcodes,c)
+ end
+end
+
function context.utfchar(k)
if type(k) == "string" then
k = tonumber(k)