summaryrefslogtreecommitdiff
path: root/src/fontloader/misc/fontloader-font-map.lua
diff options
context:
space:
mode:
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