diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2011-10-04 01:15:57 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2011-10-04 01:36:18 +0200 |
commit | 479745e00677d933056cf25f1fc2e904a4b9c567 (patch) | |
tree | bf28ac58ae76cb55790008421a387be11b88409b /otfl-font-lua.lua | |
parent | b59eb68344f3fce00c03ab075032561fe8a69950 (diff) | |
download | luaotfload-479745e00677d933056cf25f1fc2e904a4b9c567.tar.gz |
Sync with ContTeXt beta 2011.10.03 12:59
Does not run yet.
Diffstat (limited to 'otfl-font-lua.lua')
-rw-r--r-- | otfl-font-lua.lua | 46 |
1 files changed, 17 insertions, 29 deletions
diff --git a/otfl-font-lua.lua b/otfl-font-lua.lua index a6fcc16..ec3fe38 100644 --- a/otfl-font-lua.lua +++ b/otfl-font-lua.lua @@ -1,21 +1,29 @@ -if not modules then modules = { } end modules ['font-lua'] = { +if not modules then modules = { } end modules ['luatex-fonts-lua'] = { version = 1.001, - comment = "companion to font-ini.mkiv", + comment = "companion to luatex-*.tex", author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", copyright = "PRAGMA ADE / ConTeXt Development Team", license = "see context related readme files" } -local trace_defining = false trackers.register("fonts.defining", function(v) trace_defining = v end) - -local report_lua = logs.reporter("fonts","lua loading") +if context then + texio.write_nl("fatal error: this module is not for context") + os.exit() +end +local fonts = fonts fonts.formats.lua = "lua" -local readers = fonts.tfm.readers - -local function check_lua(specification,fullname) - -- standard tex file lookup +function fonts.readers.lua(specification) + local fullname = specification.filename or "" + if fullname == "" then + local forced = specification.forced or "" + if forced ~= "" then + fullname = specification.name .. "." .. forced + else + fullname = specification.name + end + end local fullname = resolvers.findfile(fullname) or "" if fullname ~= "" then local loader = loadfile(fullname) @@ -23,23 +31,3 @@ local function check_lua(specification,fullname) return loader and loader(specification) end end - -function readers.lua(specification) - local original = specification.specification - if trace_defining then - report_lua("using lua reader for '%s'",original) - end - local fullname, tfmtable = specification.filename or "", nil - if fullname == "" then - local forced = specification.forced or "" - if forced ~= "" then - tfmtable = check_lua(specification,specification.name .. "." .. forced) - end - if not tfmtable then - tfmtable = check_lua(specification,specification.name) - end - else - tfmtable = check_lua(specification,fullname) - end - return tfmtable -end |