EXPERIMENTAL: Implement file callbacks
This commit is contained in:
parent
7bea04d470
commit
063251b54f
16 changed files with 133 additions and 205 deletions
|
@ -69,7 +69,7 @@ local function readpostnames(buf, i, usedcids, encoding)
|
|||
return newusedcids
|
||||
end
|
||||
return function(filename, fontid, reencode)
|
||||
local file <close> = readfile('subset', filename, nil)
|
||||
local file <close> = readfile('truetype', filename)
|
||||
local buf = file()
|
||||
local magic, tables = sfnt.parse(buf, 1, fontid)
|
||||
if magic ~= "\0\1\0\0" then error[[Invalid TTF font]] end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue