diff options
-rw-r--r-- | tex/context/base/cont-new.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/context-version.pdf | bin | 4117 -> 4113 bytes | |||
-rw-r--r-- | tex/context/base/context.mkiv | 2 | ||||
-rw-r--r-- | tex/context/base/font-hsh.lua | 20 | ||||
-rw-r--r-- | tex/context/base/font-otf.lua | 2 | ||||
-rw-r--r-- | tex/context/base/font-sel.lua | 47 | ||||
-rw-r--r-- | tex/context/base/font-sel.mkvi | 2 | ||||
-rw-r--r-- | tex/context/base/node-met.lua | 1 | ||||
-rw-r--r-- | tex/context/base/status-files.pdf | bin | 24554 -> 25437 bytes | |||
-rw-r--r-- | tex/context/base/status-lua.pdf | bin | 225204 -> 253267 bytes | |||
-rw-r--r-- | tex/context/base/task-ini.lua | 2 | ||||
-rw-r--r-- | tex/context/base/typo-tal.lua | 31 | ||||
-rw-r--r-- | tex/generic/context/luatex/luatex-fonts-merged.lua | 4 |
13 files changed, 75 insertions, 38 deletions
diff --git a/tex/context/base/cont-new.mkiv b/tex/context/base/cont-new.mkiv index 3bff56b57..29db39968 100644 --- a/tex/context/base/cont-new.mkiv +++ b/tex/context/base/cont-new.mkiv @@ -11,7 +11,7 @@ %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. -\newcontextversion{2013.11.05 09:50} +\newcontextversion{2013.11.07 15:28} %D This file is loaded at runtime, thereby providing an excellent place for %D hacks, patches, extensions and new features. diff --git a/tex/context/base/context-version.pdf b/tex/context/base/context-version.pdf Binary files differindex 895eedd2e..99a25304b 100644 --- a/tex/context/base/context-version.pdf +++ b/tex/context/base/context-version.pdf diff --git a/tex/context/base/context.mkiv b/tex/context/base/context.mkiv index 30ccafca8..956166209 100644 --- a/tex/context/base/context.mkiv +++ b/tex/context/base/context.mkiv @@ -25,7 +25,7 @@ %D up and the dependencies are more consistent. \edef\contextformat {\jobname} -\edef\contextversion{2013.11.05 09:50} +\edef\contextversion{2013.11.07 15:28} \edef\contextkind {beta} %D For those who want to use this: diff --git a/tex/context/base/font-hsh.lua b/tex/context/base/font-hsh.lua index 773cc2b69..1b0dd08b8 100644 --- a/tex/context/base/font-hsh.lua +++ b/tex/context/base/font-hsh.lua @@ -34,6 +34,7 @@ local marks = hashes.marks or allocate() local italics = hashes.italics or allocate() local lastmathids = hashes.lastmathids or allocate() local dynamics = hashes.dynamics or allocate() +local unicodes = hashes.unicodes or allocate() hashes.characters = characters hashes.descriptions = descriptions @@ -50,6 +51,7 @@ hashes.marks = marks hashes.italics = italics hashes.lastmathids = lastmathids hashes.dynamics = dynamics +hashes.unicodes = unicodes local nodepool = nodes.pool local dummyglyph = nodepool.register(nodepool.glyph()) @@ -259,6 +261,24 @@ setmetatableindex(dynamics, function(t,k) end end) +setmetatableindex(unicodes, function(t,k) + if k == true then + return originals[currentfont()] + else + local resources = resources[k] + local originals = resources and resources.originals or { } + local characters = characters[k] + local unicodes = { } + setmetatableindex(unicodes,function(t,k) + local v = originals[characters[k].index] or k + t[k] = v + return v + end) + t[k] = unicodes + return unicodes + end +end) + function font.getfont(id) return identifiers[id] end diff --git a/tex/context/base/font-otf.lua b/tex/context/base/font-otf.lua index 6ebcb9cf9..5b10c1181 100644 --- a/tex/context/base/font-otf.lua +++ b/tex/context/base/font-otf.lua @@ -464,7 +464,7 @@ function otf.load(filename,sub,featurefile) -- second argument (format) is gone }, goodies = { }, - helpers = { + helpers = { -- might go away tounicodelist = splitter, tounicodetable = lpeg.Ct(splitter), }, diff --git a/tex/context/base/font-sel.lua b/tex/context/base/font-sel.lua index 47268ade8..fff425fa1 100644 --- a/tex/context/base/font-sel.lua +++ b/tex/context/base/font-sel.lua @@ -6,31 +6,33 @@ if not modules then modules = { } end modules ['font-sel'] = { license = "GNU General Public License" } -local context = context -local cleanname = fonts.names.cleanname -local gsub, splitup, find = string.gsub, string.splitup, string.find -local formatters = string.formatters -local settings_to_array = utilities.parsers.settings_to_array +local context = context +local cleanname = fonts.names.cleanname +local gsub, splitup, find = string.gsub, string.splitup, string.find +local splitbase, removesuffix = file.splitbase, file.removesuffix -local v_yes = interfaces.variables.yes -local v_simplefonts = interfaces.variables.simplefonts -local v_selectfont = interfaces.variables.selectfont -local v_default = interfaces.variables.default +local formatters = string.formatters +local settings_to_array = utilities.parsers.settings_to_array -local selectfont = fonts.select or { } -fonts.select = selectfont +local v_yes = interfaces.variables.yes +local v_simplefonts = interfaces.variables.simplefonts +local v_selectfont = interfaces.variables.selectfont +local v_default = interfaces.variables.default -local data = selectfont.data or { } -selectfont.data = data +local selectfont = fonts.select or { } +fonts.select = selectfont -local fallbacks = selectfont.fallbacks or { } -selectfont.fallbacks = fallbacks +local data = selectfont.data or { } +selectfont.data = data -local methods = selectfont.methods or { } -selectfont.methods = methods +local fallbacks = selectfont.fallbacks or { } +selectfont.fallbacks = fallbacks -local getlookups = fonts.names.getlookups -local registerdesignsizes = fonts.goodies.designsizes.register +local methods = selectfont.methods or { } +selectfont.methods = methods + +local getlookups = fonts.names.getlookups +local registerdesignsizes = fonts.goodies.designsizes.register local alternatives = { ["tf"] = "regular", @@ -382,7 +384,7 @@ end methods["file"] = function(data,alternative,filename) local data = data local family = data.metadata.family - local filename = gsub(file.removesuffix(filename),"*",family) + local filename = gsub(removesuffix(filename),"*",family) local filename = getlookups{ cleanfilename = cleanname(filename) } if #filename > 0 then savefont(data,alternative,filename) @@ -480,15 +482,16 @@ local function definefontsynonym(data,alternative,index,fallback) for _, entry in next, fontdata do if entry["minsize"] and entry["maxsize"] then if size[1] > entry["minsize"] and size[1] <= entry["maxsize"] then - registerdesignsizes( fontfile, size[2], entry["filename"] ) + local filepath, filename = splitbase(entry["filename"]) + registerdesignsizes( fontfile, size[2], filename ) end end end end for _, entry in next, fontdata do - local filename = entry["filename"] local designsize = entry["designsize"] or 100 if designsize == 100 or designsize == 120 or designsize == 0 then + local filepath, filename = splitbase(entry["filename"]) registerdesignsizes( fontfile, "default", filename ) break end diff --git a/tex/context/base/font-sel.mkvi b/tex/context/base/font-sel.mkvi index 2c022473b..3d4dc6807 100644 --- a/tex/context/base/font-sel.mkvi +++ b/tex/context/base/font-sel.mkvi @@ -364,4 +364,4 @@ \c!smallcapsfeatures=\s!smallcaps, \c!style=\s!rm] -\protect
\ No newline at end of file +\protect diff --git a/tex/context/base/node-met.lua b/tex/context/base/node-met.lua index d6b3df213..7d10ce9f8 100644 --- a/tex/context/base/node-met.lua +++ b/tex/context/base/node-met.lua @@ -91,6 +91,7 @@ nodes.traverse_id = node.traverse_id nodes.slide = node.slide nodes.vpack = node.vpack nodes.fields = node.fields +nodes.is_node = node.is_node nodes.first_glyph = node.first_glyph nodes.first_character = node.first_character diff --git a/tex/context/base/status-files.pdf b/tex/context/base/status-files.pdf Binary files differindex 868cec117..83a5e5d03 100644 --- a/tex/context/base/status-files.pdf +++ b/tex/context/base/status-files.pdf diff --git a/tex/context/base/status-lua.pdf b/tex/context/base/status-lua.pdf Binary files differindex 4fd46f9d3..73535bb60 100644 --- a/tex/context/base/status-lua.pdf +++ b/tex/context/base/status-lua.pdf diff --git a/tex/context/base/task-ini.lua b/tex/context/base/task-ini.lua index 51aa550cb..3447214bd 100644 --- a/tex/context/base/task-ini.lua +++ b/tex/context/base/task-ini.lua @@ -27,7 +27,6 @@ appendaction("processors", "normalizers", "typesetters.characters.handler") appendaction("processors", "normalizers", "fonts.collections.process") -- disabled appendaction("processors", "normalizers", "fonts.checkers.missing") -- disabled -appendaction("processors", "characters", "typesetters.characteralign.handler") -- disabled appendaction("processors", "characters", "scripts.autofontfeature.handler") appendaction("processors", "characters", "scripts.splitters.handler") -- disabled appendaction("processors", "characters", "typesetters.cleaners.handler") -- disabled @@ -51,6 +50,7 @@ appendaction("processors", "fonts", "builders.kernel.kerning") appendaction("processors", "fonts", "nodes.handlers.stripping") -- disabled (might move) ------------("processors", "fonts", "typesetters.italics.handler") -- disabled (after otf/kern handling) +appendaction("processors", "lists", "typesetters.characteralign.handler") -- disabled (we need to to this after otf appliance) appendaction("processors", "lists", "typesetters.spacings.handler") -- disabled appendaction("processors", "lists", "typesetters.kerns.handler") -- disabled appendaction("processors", "lists", "typesetters.digits.handler") -- disabled (after otf handling) diff --git a/tex/context/base/typo-tal.lua b/tex/context/base/typo-tal.lua index 3df8dd00a..4cfd27d91 100644 --- a/tex/context/base/typo-tal.lua +++ b/tex/context/base/typo-tal.lua @@ -17,6 +17,7 @@ local glyph_code = nodecodes.glyph local glue_code = nodecodes.glue local fontcharacters = fonts.hashes.characters +local unicodes = fonts.hashes.unicodes local categories = characters.categories -- nd local insert_node_before = nodes.insert_before @@ -72,7 +73,12 @@ function characteralign.handler(head,where) if not datasets then return head, false end - local first = first_glyph(head) -- we could do that once + -- local first = first_glyph(head) -- we could do that once + local first + for n in traverse_list_by_id(glyhp_code,head) do + first = n + break + end if not first then return head, false end @@ -97,12 +103,17 @@ function characteralign.handler(head,where) local id = current.id if id == glyph_code then local char = current.char - if char == separator then + local font = current.font + local unicode = unicodes[font][char] + if not unicode then + -- no unicode so forget about it + elseif unicode == separator then c = current if trace_split then setcolor(current,"darkred") end - elseif categories[char] == "nd" or validseparators[char] then + dataset.hasseparator = true + elseif categories[unicode] == "nd" or validseparators[unicode] then if c then if not a_start then a_start = current @@ -137,10 +148,10 @@ function characteralign.handler(head,where) end end elseif not b_start then - sign = validsigns[char] and current + sign = validsigns[unicode] and current end elseif (b_start or a_start) and id == glue_code then - -- somewhat inefficient + -- somewhat inefficient local next = current.next local prev = current.prev if next and prev and next.id == glyph_code and prev.id == glyph_code then -- too much checking @@ -169,12 +180,12 @@ function characteralign.handler(head,where) maxafter = after end end - dataset.maxafter = maxafter dataset.maxbefore = maxbefore + dataset.maxafter = maxafter dataset.collected = true end - local maxafter = dataset.maxafter local maxbefore = dataset.maxbefore + local maxafter = dataset.maxafter local before = entry.before or 0 local after = entry.after or 0 local new_kern = trace_split and traced_kern or new_kern @@ -184,8 +195,10 @@ function characteralign.handler(head,where) end if not c then -- print("[before]") - local width = fontcharacters[b_stop.font][separator].width - insert_node_after(head,b_stop,new_kern(maxafter+width)) + if dataset.hasseparator then + local width = fontcharacters[b_stop.font][separator].width + insert_node_after(head,b_stop,new_kern(maxafter+width)) + end elseif a_start then -- print("[before] [separator] [after]") if after < maxafter then diff --git a/tex/generic/context/luatex/luatex-fonts-merged.lua b/tex/generic/context/luatex/luatex-fonts-merged.lua index 8163ae8ad..b426ce304 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 : luatex-fonts-merged.lua -- parent file : luatex-fonts.lua --- merge date : 11/05/13 09:50:05 +-- merge date : 11/07/13 15:28:28 do -- begin closure to overcome local limits and interference @@ -6725,7 +6725,7 @@ function otf.load(filename,sub,featurefile) }, descriptions={}, goodies={}, - helpers={ + helpers={ tounicodelist=splitter, tounicodetable=lpeg.Ct(splitter), }, |