Skip to content
This repository has been archived by the owner on Aug 17, 2019. It is now read-only.

Commit

Permalink
[fontloader] sync with Context as of 2016-05-09
Browse files Browse the repository at this point in the history
Fixes lualatex#349 and lualatex#357.

Also the new AFM code is due, let’s see what else we need to use it.
  • Loading branch information
phi-gamma committed May 9, 2016
1 parent 0ba7124 commit 195d57d
Show file tree
Hide file tree
Showing 7 changed files with 2,674 additions and 2,632 deletions.
20 changes: 11 additions & 9 deletions src/fontloader/misc/fontloader-font-gbn.lua
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,19 @@ function nodes.handlers.nodepass(head)
local variant = hash[getchar(p)]
if variant then
setchar(p,variant)
if not redundant then
redundant = { n }
else
redundant[#redundant+1] = n
end
end
end
end
-- per generic user request we always remove selectors
if not redundant then
redundant = { n }
else
redundant[#redundant+1] = n
end
end
end
end
local nofbasefonts = #basefonts
if redundant then
for i=1,#redundant do
local r = redundant[i]
Expand All @@ -147,8 +149,8 @@ function nodes.handlers.nodepass(head)
else
setlink(p,n)
end
if b > 0 then
for i=1,b do
if nofbasefonts > 0 then
for i=1,nofbasefonts do
local bi = basefonts[i]
if r == bi[1] then
bi[1] = n
Expand Down Expand Up @@ -192,8 +194,8 @@ function nodes.handlers.nodepass(head)
end
end
end
if basemodepass and #basefonts > 0 then
for i=1,#basefonts do
if basemodepass and nofbasefonts > 0 then
for i=1,nofbasefonts do
local range = basefonts[i]
local start = range[1]
local stop = range[2]
Expand Down
30 changes: 15 additions & 15 deletions src/fontloader/misc/fontloader-font-otj.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1255,11 +1255,11 @@ local function inject_everything(head,where)
insert_node_after(pre,n,newkern(rightkern))
done = true
end
end
if hasmarks then
local pm = i.markbasenode
if pm then
processmark(pm,current,i)
if hasmarks then
local pm = i.markbasenode
if pm then
processmark(pm,current,i)
end
end
end
end
Expand Down Expand Up @@ -1287,11 +1287,11 @@ local function inject_everything(head,where)
insert_node_after(post,n,newkern(rightkern))
done = true
end
end
if hasmarks then
local pm = i.markbasenode
if pm then
processmark(pm,current,i)
if hasmarks then
local pm = i.markbasenode
if pm then
processmark(pm,current,i)
end
end
end
end
Expand Down Expand Up @@ -1319,11 +1319,11 @@ local function inject_everything(head,where)
insert_node_after(replace,n,newkern(rightkern))
done = true
end
end
if hasmarks then
local pm = i.markbasenode
if pm then
processmark(pm,current,i)
if hasmarks then
local pm = i.markbasenode
if pm then
processmark(pm,current,i)
end
end
end
end
Expand Down
8 changes: 7 additions & 1 deletion src/fontloader/misc/fontloader-font-otl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ registerdirective("fonts.otf.loader.forcenotdef", function(v) forcenotdef =
-- end
-- end

-- Enhancers are used to apply fixes and extensions to fonts. For instance, we use them
-- to implement tlig and trep features. They are not neccessarily bound to opentype
-- fonts but can also apply to type one fonts, given that they obey the structure of an
-- opentype font. They are not to be confused with format specific features but maybe
-- some are so generic that they might eventually move to this mechanism.

local ordered_enhancers = {
"check extra features",
}
Expand Down Expand Up @@ -302,7 +308,7 @@ function otf.load(filename,sub,featurefile) -- second argument (format) is gone
--
enhancers.apply(data,filename,data)
--
constructors.addcoreunicodes(unicodes)
-- constructors.addcoreunicodes(data.resources.unicodes) -- still needed ?
--
if applyruntimefixes then
applyruntimefixes(filename,data)
Expand Down
2 changes: 2 additions & 0 deletions src/fontloader/misc/fontloader-font-oto.lua
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,5 @@ registerotffeature {
base = featuresinitializer,
}
}

otf.basemodeinitializer = featuresinitializer
3 changes: 3 additions & 0 deletions src/fontloader/misc/fontloader-font-ots.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3652,6 +3652,9 @@ registerotffeature {
}
}

otf.nodemodeinitializer = featuresinitializer
otf.featuresprocessor = featuresprocessor

-- This can be used for extra handlers, but should be used with care!

otf.handlers = handlers -- used in devanagari
Expand Down
7 changes: 5 additions & 2 deletions src/fontloader/misc/fontloader-fonts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,6 @@ if non_generic_context.luatex_fonts.skip_loading ~= true then
loadmodule('luatex-fonts-syn.lua')

loadmodule('font-tfm.lua')
loadmodule('font-afm.lua')
loadmodule('font-afk.lua')
loadmodule('font-oti.lua')

-- These are the old loader and processing modules. These use the built-in font loader and
Expand Down Expand Up @@ -260,6 +258,11 @@ if non_generic_context.luatex_fonts.skip_loading ~= true then
loadmodule('font-ots.lua')
loadmodule('font-osd.lua')

-- type one code

loadmodule('font-one.lua') -- was font-afm.lua
loadmodule('font-afk.lua')

-- common code

loadmodule('font-lua.lua')
Expand Down
Loading

0 comments on commit 195d57d

Please sign in to comment.