diff options
author | Hans Hagen <pragma@wxs.nl> | 2011-03-25 18:03:00 +0100 |
---|---|---|
committer | Hans Hagen <pragma@wxs.nl> | 2011-03-25 18:03:00 +0100 |
commit | 4ed30744220cf0763f968c837b0ff7dd367f19b2 (patch) | |
tree | 28d1dce431e679b3a6d28edef78cb38096d4c94f /tex/context/base/scrp-ini.lua | |
parent | 3c5dbaefc44f38d6da23a7db2c06a0a4af0996fa (diff) | |
download | context-4ed30744220cf0763f968c837b0ff7dd367f19b2.tar.gz |
beta 2011.03.25 18:03
Diffstat (limited to 'tex/context/base/scrp-ini.lua')
-rw-r--r-- | tex/context/base/scrp-ini.lua | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/tex/context/base/scrp-ini.lua b/tex/context/base/scrp-ini.lua index 846d74d87..543211c36 100644 --- a/tex/context/base/scrp-ini.lua +++ b/tex/context/base/scrp-ini.lua @@ -35,10 +35,9 @@ local glue_code = nodecodes.glue local a_preproc = attributes.private('preproc') local a_prestat = attributes.private('prestat') -local fontdata = fonts.identifiers +local fontdata = fonts.hashes.identifiers -local fcs = fonts.colors.set -- move this to tracers -local fcr = fonts.colors.reset +local setnodecolor = nodes.tracers.colors.set scripts = scripts or { } local scripts = scripts @@ -278,7 +277,7 @@ local scriptcolors = allocate { -- todo: just named colors scripts.colors = scriptcolors -local numbertokind = allocate { -- rather bound to cjk ... will be generalized +local numbertocategory = allocate { -- rather bound to cjk ... will be generalized "korean", "chinese", "full_width_open", @@ -292,20 +291,18 @@ local numbertokind = allocate { -- rather bound to cjk ... will be generalized "jamo_final", } -local kindtonumber = allocate(table.swapped(numbertokind)) -- could be one table +local categorytonumber = allocate(table.swapped(numbertocategory)) -- could be one table -scripts.kindtonumber = kindtonumber -scripts.numbertokind = numbertokind - --- some time i will make a fonts.originals[id] +scripts.categorytonumber = categorytonumber +scripts.numbertocategory = numbertocategory local function colorize(start,stop) for n in traverse_id(glyph_code,start) do - local kind = numbertokind[has_attribute(n,a_prestat)] + local kind = numbertocategory[has_attribute(n,a_prestat)] if kind then local ac = scriptcolors[kind] if ac then - fcs(n,ac) + setnodecolor(n,ac) end end if n == stop then @@ -364,14 +361,14 @@ function scripts.preprocess(head) if normal_process then local f = start.font if f ~= lastfont then - originals = fontdata[f].originals + originals = fontdata[f].resources.originals lastfont = f end local c = start.char if originals then c = originals[c] or c end local h = hash[c] if h then - set_attribute(start,a_prestat,kindtonumber[h]) + set_attribute(start,a_prestat,categorytonumber[h]) if not first then first, last = start, start else |