summaryrefslogtreecommitdiff
path: root/src/fontloader/misc/fontloader-font-map.lua
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2015-05-26 08:13:25 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2015-05-26 08:13:25 +0200
commit7bad2f7429de8354f0105108ea495c0c6b85291b (patch)
tree9591284b4b1cecf40be12292ccc901743a1a57f9 /src/fontloader/misc/fontloader-font-map.lua
parent0a03da95e41ed2e4e1082ebde9f20461aa6b1842 (diff)
downloadluaotfload-7bad2f7429de8354f0105108ea495c0c6b85291b.tar.gz
[fontloader] sync with Context as of 2015-05-26
Diffstat (limited to 'src/fontloader/misc/fontloader-font-map.lua')
-rw-r--r--src/fontloader/misc/fontloader-font-map.lua53
1 files changed, 53 insertions, 0 deletions
diff --git a/src/fontloader/misc/fontloader-font-map.lua b/src/fontloader/misc/fontloader-font-map.lua
index 449a00f..69474ba 100644
--- a/src/fontloader/misc/fontloader-font-map.lua
+++ b/src/fontloader/misc/fontloader-font-map.lua
@@ -313,6 +313,59 @@ function mappings.addtounicode(data,filename)
-- The next time I look into this, I'll add an extra analysis step to the otf loader (we can
-- resolve some tounicodes by looking into the gsub data tables that are bound to glyphs.
--
+-- a real tricky last resort:
+--
+-- local lookups = glyph.lookups
+-- if lookups then
+-- for _, lookup in next, lookups do -- assume consistency else we need to sort
+-- for i=1,#lookup do
+-- local l = lookup[i]
+-- if l.type == "ligature" then
+-- local s = l.specification
+-- if s.char == glyph.name then
+-- local components = s.components
+-- if components then
+-- local t, n = { }, 0
+-- unicode = true
+-- for l=1,#components do
+-- local base = components[l]
+-- local u = unicodes[base] or unicodevector[base]
+-- if not u then
+-- break
+-- elseif type(u) == "table" then
+-- if u[1] >= private then
+-- unicode = false
+-- break
+-- end
+-- n = n + 1
+-- t[n] = u[1]
+-- else
+-- if u >= private then
+-- unicode = false
+-- break
+-- end
+-- n = n + 1
+-- t[n] = u
+-- end
+-- end
+-- if n == 0 then -- done then
+-- -- nothing
+-- elseif n == 1 then
+-- glyph.unicode = t[1]
+-- else
+-- glyph.unicode = t
+-- end
+-- nl = nl + 1
+-- break
+-- end
+-- end
+-- end
+-- end
+-- if unicode then
+-- break
+-- end
+-- end
+-- end
if not unicode or unicode == "" then
local split = lpegmatch(namesplitter,name)
local nsplit = split and #split or 0