diff options
author | Hans Hagen <pragma@wxs.nl> | 2020-06-19 12:25:31 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2020-06-19 12:25:31 +0200 |
commit | 63bb70d210dc6e8a17959c4e056fe41da3f1c398 (patch) | |
tree | eec8ab8eea553b8c5beea443624d725bb8d4f07e /tex/context/base/mkiv/scrp-tib.lua | |
parent | f46fe99c7c361a66c68987b22d235fe9f793fad6 (diff) | |
download | context-63bb70d210dc6e8a17959c4e056fe41da3f1c398.tar.gz |
2020-06-19 11:07:00
Diffstat (limited to 'tex/context/base/mkiv/scrp-tib.lua')
-rw-r--r-- | tex/context/base/mkiv/scrp-tib.lua | 31 |
1 files changed, 10 insertions, 21 deletions
diff --git a/tex/context/base/mkiv/scrp-tib.lua b/tex/context/base/mkiv/scrp-tib.lua index b67f69648..b1d50a469 100644 --- a/tex/context/base/mkiv/scrp-tib.lua +++ b/tex/context/base/mkiv/scrp-tib.lua @@ -12,25 +12,17 @@ local getnext = nuts.getnext local getattr = nuts.getattr local ischar = nuts.ischar -local a_scriptstatus = attributes.private('scriptstatus') +local getscriptstatus = scripts.getstatus -local numbertocategory = scripts.numbertocategory local inserters = scripts.inserters +local colors = scripts.colors local injectors = { - breaking_tsheg = inserters.space_after, + breaking_tsheg = inserters.space_after } --- more efficient is to check directly --- --- local b_tsheg = 0x0F0B -- breaking --- local n_tsheg = 0x0F0C -- nonbreaking --- --- if char == b_tsheg then --- head, current = insert_space_after(head,current) --- end --- --- but this is more general +colors.breaking_tsheg = "trace:1" +colors.nonbreaking_tsheg = "trace:2" local function process(head,first,last) if first ~= last then @@ -38,14 +30,11 @@ local function process(head,first,last) while current do local char, id = ischar(current) if char then - local scriptstatus = getattr(current,a_scriptstatus) - if scriptstatus and scriptstatus > 0 then - local category = numbertocategory[scriptstatus] - if category then - local injector = injectors[category] - if injector then - head, current = injector(head,current) - end + local category = getscriptstatus(current) + if category then + local injector = injectors[category] + if injector then + head, current = injector(head,current) end end end |