diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-12-28 11:57:23 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-12-28 11:57:23 +0100 |
commit | 2f8058544f8a3fead8186bdcb3835f1f67416cc3 (patch) | |
tree | 499caa2670374128935c3e4ef663a6a578703df1 /tex/generic | |
parent | 979450762f4ef3b885fd63984c91165726494564 (diff) | |
download | context-2f8058544f8a3fead8186bdcb3835f1f67416cc3.tar.gz |
2018-12-28 11:09:00
Diffstat (limited to 'tex/generic')
-rw-r--r-- | tex/generic/context/luatex/luatex-core.lua | 2 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 98 |
2 files changed, 58 insertions, 42 deletions
diff --git a/tex/generic/context/luatex/luatex-core.lua b/tex/generic/context/luatex/luatex-core.lua index 35518c0e8..6e1b31e96 100644 --- a/tex/generic/context/luatex/luatex-core.lua +++ b/tex/generic/context/luatex/luatex-core.lua @@ -376,6 +376,8 @@ do if not loaded.socket then loaded.socket = loaded["socket.core"] end if not loaded.mime then loaded.mime = loaded["mime.core"] end + if not loaded.lfs then loaded.lfs = lfs end + end do diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 0c9bfcc38..b3afbafa1 100644 --- a/tex/generic/context/luatex/luatex-fonts-merged.lua +++ b/tex/generic/context/luatex/luatex-fonts-merged.lua @@ -1,6 +1,6 @@ -- merged file : c:/data/develop/context/sources/luatex-fonts-merged.lua -- parent file : c:/data/develop/context/sources/luatex-fonts.lua --- merge date : 12/19/18 19:22:22 +-- merge date : 12/28/18 11:01:18 do -- begin closure to overcome local limits and interference @@ -13531,7 +13531,7 @@ statistics.usedfeatures=usedfeatures table.setmetatableindex(usedfeatures,function(t,k) if k then local v={} t[k]=v return v end end) storage.register("fonts/otf/usedfeatures",usedfeatures,"fonts.handlers.otf.statistics.usedfeatures" ) local normalizedaxis=otf.readers.helpers.normalizedaxis or function(s) return s end -function otffeatures.normalize(features) +function otffeatures.normalize(features,wrap) if features then local h={} for key,value in next,features do @@ -13557,7 +13557,11 @@ function otffeatures.normalize(features) elseif type(value)=="string" then local b=is_boolean(value) if type(b)=="nil" then - uv=lower(value) + if wrap and find(value,",") then + uv="{"..lower(value).."}" + else + uv=lower(value) + end else uv=b end @@ -25696,8 +25700,8 @@ local disc_code=nodecodes.disc local math_code=nodecodes.math local dir_code=nodecodes.dir local localpar_code=nodecodes.localpar -local discretionary_code=disccodes.discretionary -local ligature_code=glyphcodes.ligature +local discretionarydisc_code=disccodes.discretionary +local ligatureglyph_code=glyphcodes.ligature local a_state=attributes.private('state') local a_noligature=attributes.private("noligature") local injections=nodes.injections @@ -25864,7 +25868,7 @@ local set_components=setcomponents local function count_components(start,marks) if getid(start)~=glyph_code then return 0 - elseif getsubtype(start)==ligature_code then + elseif getsubtype(start)==ligatureglyph_code then local i=0 local components=getcomponents(start) while components do @@ -25892,7 +25896,7 @@ local function markstoligature(head,start,stop,char) end resetinjection(base) setchar(base,char) - setsubtype(base,ligature_code) + setsubtype(base,ligatureglyph_code) set_components(base,start) setlink(prev,base,next) return head,base @@ -25918,7 +25922,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou end resetinjection(base) setchar(base,char) - setsubtype(base,ligature_code) + setsubtype(base,ligatureglyph_code) set_components(base,comp) setlink(prev,base,next) if not discfound then @@ -25989,7 +25993,7 @@ local function toligature(head,start,stop,char,dataset,sequence,skiphash,discfou set_components(base,copied) replace=base if forcediscretionaries then - setdisc(discfound,pre,post,replace,discretionary_code) + setdisc(discfound,pre,post,replace,discretionarydisc_code) else setdisc(discfound,pre,post,replace) end @@ -28560,41 +28564,51 @@ local function k_run_multiple(sub,injection,last,font,attr,steps,nofsteps,datase end end end -local function txtdirstate(start,stack,top,rlparmode) - local nxt=getnext(start) - local dir=getdir(start) - if dir=="+TRT" then - top=top+1 - stack[top]=dir - return nxt,top,-1 - elseif dir=="+TLT" then - top=top+1 - stack[top]=dir - return nxt,top,1 - elseif dir=="-TRT" or dir=="-TLT" then - if top==1 then - return nxt,0,rlparmode - else - top=top-1 - if stack[top]=="+TRT" then - return nxt,top,-1 +local txtdirstate,pardirstate do + local getdirection=nuts.getdirection + local lefttoright=0 + local rightoleft=1 + txtdirstate=function(start,stack,top,rlparmode) + local nxt=getnext(start) + local dir,pop=getdirection(start) + if pop then + if top==1 then + return nxt,0,rlparmode else - return nxt,top,1 + top=top-1 + if stack[top]==righttoleft then + return nxt,top,-1 + else + return nxt,top,1 + end end + elseif dir==lefttoright then + top=top+1 + stack[top]=0 + return nxt,top,1 + elseif dir==righttoleft then + top=top+1 + stack[top]=1 + return nxt,top,-1 + else + return nxt,top,rlparmode end - else - return nxt,top,rlparmode end -end -local function pardirstate(start) - local nxt=getnext(start) - local dir=getdir(start) - if dir=="TLT" then - return nxt,1,1 - elseif dir=="TRT" then - return nxt,-1,-1 - else - return nxt,0,0 + pardirstate=function(start) + local nxt=getnext(start) + local dir=getdirection(start) + if dir==lefttoright then + return nxt,1,1 + end + if dir==righttoleft then + return nxt,-1,-1 + elseif dir=="TRT" then + return nxt,1,1 + elseif dir=="TLT" then + return nxt,-1,-1 + else + return nxt,0,0 + end end end otf.helpers=otf.helpers or {} @@ -28642,7 +28656,7 @@ do if trace_steps then checkstep(head) end - local initialrl=direction=="TRT" and -1 or 0 + local initialrl=(direction==1 or direction=="TRT") and -1 or 0 local datasets=otfdataset(tfmdata,font,attr) local dirstack={ nil } sweephead={} @@ -28866,7 +28880,7 @@ do local done=false local dirstack={ nil } local start=head - local initialrl=direction=="TRT" and -1 or 0 + local initialrl=(direction==1 or direction=="TRT") and -1 or 0 local rlmode=initialrl local rlparmode=initialrl local topstack=0 |