From 7bad2f7429de8354f0105108ea495c0c6b85291b Mon Sep 17 00:00:00 2001 From: Philipp Gesang Date: Tue, 26 May 2015 08:13:25 +0200 Subject: [fontloader] sync with Context as of 2015-05-26 --- src/fontloader/misc/fontloader-font-map.lua | 53 +++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'src/fontloader/misc/fontloader-font-map.lua') 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 -- cgit v1.2.3