diff options
author | Hans Hagen <pragma@wxs.nl> | 2007-08-20 10:21:00 +0200 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2007-08-20 10:21:00 +0200 |
commit | deecfe09c774d4c2835f6999b2cdd9ca07e9bdae (patch) | |
tree | c921185fc4f848363c7d2ebf48a24e575c8194fe /tex/context/base/syst-con.lua | |
parent | 14fbfde2ad32d2fe4a831aa9007877e5cb5764be (diff) | |
download | context-deecfe09c774d4c2835f6999b2cdd9ca07e9bdae.tar.gz |
stable 2007.08.20 10:21
Diffstat (limited to 'tex/context/base/syst-con.lua')
-rw-r--r-- | tex/context/base/syst-con.lua | 44 |
1 files changed, 21 insertions, 23 deletions
diff --git a/tex/context/base/syst-con.lua b/tex/context/base/syst-con.lua index 273bc5b5c..9f35d68b6 100644 --- a/tex/context/base/syst-con.lua +++ b/tex/context/base/syst-con.lua @@ -1,30 +1,28 @@ --- filename : syst-con.lua --- comment : companion to syst-con.tex (in ConTeXt) --- author : Hans Hagen, PRAGMA-ADE, Hasselt NL --- copyright: PRAGMA ADE / ConTeXt Development Team --- license : see context related readme files +if not modules then modules = { } end modules ['syst-con'] = { + version = 1.001, + comment = "companion to syst-con.tex", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} --- remark : compact version +converters = converters or { } -if not versions then versions = { } end versions['syst-con'] = 1.001 -if not convert then convert = { } end - --- For raw 8 bit characters, the offset is 0x110000 (bottom of plane 18) --- at the top of luatex's char range but outside the unicode range. - -function convert.lchexnumber (n) tex.sprint(string.format("%x" ,n)) end -function convert.uchexnumber (n) tex.sprint(string.format("%X" ,n)) end -function convert.lchexnumbers (n) tex.sprint(string.format("%02x",n)) end -function convert.uchexnumbers (n) tex.sprint(string.format("%02X",n)) end -function convert.octnumber (n) tex.sprint(string.format("%03o",n)) end -function convert.hexstringtonumber(n) tex.sprint(tonumber(n,16)) end -function convert.octstringtonumber(n) tex.sprint(tonumber(n, 8)) end -function convert.rawcharacter (n) tex.sprint(unicode.utf8.char(0x110000+n)) end +--[[ldx-- +<p>For raw 8 bit characters, the offset is 0x110000 (bottom of plane 18) at +the top of <l n='luatex'/>'s char range but outside the unicode range.</p> +--ldx]]-- do - local char = unicode.utf8.char - local flush = tex.sprint + local char, flush, format = unicode.utf8.char, tex.sprint, string.format - function convert.rawcharacter(n) flush(char(0x110000+n)) end + function converters.lchexnumber (n) flush(format("%x" ,n)) end + function converters.uchexnumber (n) flush(format("%X" ,n)) end + function converters.lchexnumbers (n) flush(format("%02x",n)) end + function converters.uchexnumbers (n) flush(format("%02X",n)) end + function converters.octnumber (n) flush(format("%03o",n)) end + function converters.hexstringtonumber(n) flush(tonumber(n,16)) end + function converters.octstringtonumber(n) flush(tonumber(n, 8)) end + function converters.rawcharacter (n) flush(char(0x110000+n)) end end |