summaryrefslogtreecommitdiff
path: root/tex/context/base/mkxl/char-tex.lmt
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkxl/char-tex.lmt')
-rw-r--r--tex/context/base/mkxl/char-tex.lmt68
1 files changed, 22 insertions, 46 deletions
diff --git a/tex/context/base/mkxl/char-tex.lmt b/tex/context/base/mkxl/char-tex.lmt
index 31023136d..0ac297d59 100644
--- a/tex/context/base/mkxl/char-tex.lmt
+++ b/tex/context/base/mkxl/char-tex.lmt
@@ -46,17 +46,14 @@ local trace_defining = false trackers.register("characters.defining", fu
local report_defining = logs.reporter("characters")
---[[ldx--
-<p>In order to deal with 8-bit output, we need to find a way to go from <l n='utf'/> to
-8-bit. This is handled in the <l n='luatex'/> engine itself.</p>
-
-<p>This leaves us problems with characters that are specific to <l n='tex'/> like
-<type>{}</type>, <type>$</type> and alike. We can remap some chars that tex input files
-are sensitive for to a private area (while writing to a utility file) and revert then
-to their original slot when we read in such a file. Instead of reverting, we can (when
-we resolve characters to glyphs) map them to their right glyph there. For this purpose
-we can use the private planes 0x0F0000 and 0x100000.</p>
---ldx]]--
+-- In order to deal with 8-bit output, we need to find a way to go from UTF to
+-- 8-bit. This is handled in the 32 bit engine itself. This leaves us problems with
+-- characters that are specific to TeX, like curly braces and dollars. We can remap
+-- some chars that tex input files are sensitive for to a private area (while
+-- writing to a utility file) and revert then to their original slot when we read in
+-- such a file. Instead of reverting, we can (when we resolve characters to glyphs)
+-- map them to their right glyph there. For this purpose we can use the private
+-- planes 0x0F0000 and 0x100000.
local low = allocate()
local high = allocate()
@@ -106,21 +103,6 @@ private.escape = utf.remapper(escapes) -- maybe: ,"dynamic"
private.replace = utf.remapper(low) -- maybe: ,"dynamic"
private.revert = utf.remapper(high) -- maybe: ,"dynamic"
---[[ldx--
-<p>We get a more efficient variant of this when we integrate
-replacements in collapser. This more or less renders the previous
-private code redundant. The following code is equivalent but the
-first snippet uses the relocated dollars.</p>
-
-<typing>
-[󰀤x󰀤] [$x$]
-</typing>
---ldx]]--
-
--- using the tree-lpeg-mapper would be nice but we also need to deal with end-of-string
--- cases: "\"\i" and don't want "\relax" to be seen as \r e lax" (for which we need to mess
--- with spaces
-
local accentmapping = allocate {
['"'] = { [""] = "¨",
A = "Ä", a = "ä",
@@ -288,12 +270,12 @@ local commandmapping = allocate {
texcharacters.commandmapping = commandmapping
-local ligaturemapping = allocate {
- ["''"] = "”",
- ["``"] = "“",
- ["--"] = "–",
- ["---"] = "—",
-}
+-- local ligaturemapping = allocate {
+-- ["''"] = "”",
+-- ["``"] = "“",
+-- ["--"] = "–",
+-- ["---"] = "—",
+-- }
-- Older accent handling code can be found in char-def.lua but in the meantime
-- we moved on. First the one with commands:
@@ -321,9 +303,9 @@ local function toutfpattern()
hash["{\\"..k.."}"] = v
hash["{\\"..k.." }"] = v
end
- for k, v in next, ligaturemapping do
- hash[k] = v
- end
+ -- for k, v in next, ligaturemapping do
+ -- hash[k] = v
+ -- end
untex = utfchartabletopattern(hash) / hash
end
return untex
@@ -376,9 +358,9 @@ local function toutfpattern()
for k, v in next, commandmapping do
hash[k] = v
end
- for k, v in next, ligaturemapping do
- hash[k] = v
- end
+ -- for k, v in next, ligaturemapping do
+ -- hash[k] = v
+ -- end
untex = utfchartabletopattern(hash) / hash
end
return untex
@@ -580,10 +562,8 @@ implement { -- a waste of scanner but consistent
actions = texcharacters.defineaccents
}
---[[ldx--
-<p>Instead of using a <l n='tex'/> file to define the named glyphs, we
-use the table. After all, we have this information available anyway.</p>
---ldx]]--
+-- Instead of using a TeX file to define the named glyphs, we use the table. After
+-- all, we have this information available anyway.
local function to_number(s)
local n = tonumber(s)
@@ -878,10 +858,6 @@ function characters.setactivecatcodes(cct)
tex.catcodetable = saved
end
---[[ldx--
-<p>Setting the lccodes is also done in a loop over the data table.</p>
---ldx]]--
-
implement {
name = "chardescription",
arguments = "integer",