diff options
author | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-07 03:46:47 -0700 |
---|---|---|
committer | Philipp Gesang <phg42.2a@gmail.com> | 2013-08-07 03:46:47 -0700 |
commit | 276d4f282bc6b9899fb026a0b96c2eb1f9219e35 (patch) | |
tree | 36ca2231814c48e0f2b954ca12e7ce779a552aa6 /luaotfload-features.lua | |
parent | 86a83bbbd05bdbec3c4d08b16dee864ab05b5dd7 (diff) | |
parent | 749917ae9796808d937c38375ebdb3fbfb0fcc1c (diff) | |
download | luaotfload-276d4f282bc6b9899fb026a0b96c2eb1f9219e35.tar.gz |
Merge pull request #119 from phi-gamma/master
type1 support, improve design size handling, better ``--find``, various fixes
Diffstat (limited to 'luaotfload-features.lua')
-rw-r--r-- | luaotfload-features.lua | 40 |
1 files changed, 26 insertions, 14 deletions
diff --git a/luaotfload-features.lua b/luaotfload-features.lua index 4088379..db0b1d0 100644 --- a/luaotfload-features.lua +++ b/luaotfload-features.lua @@ -14,11 +14,25 @@ local lpegmatch = lpeg.match ---[[ begin included font-ltx.lua ]] --- this appears to be based in part on luatex-fonts-def.lua -local fonts = fonts +local fonts = fonts +local definers = fonts.definers +local handlers = fonts.handlers + +local as_script, normalize + +if handlers then + normalize = handlers.otf.features.normalize +else + normalize = function () end + as_script = true +end + --HH A bit of tuning for definitions. -fonts.constructors.namemode = "specification" -- somehow latex needs this (changed name!) => will change into an overload +if fonts.constructors then + fonts.constructors.namemode = "specification" -- somehow latex needs this (changed name!) => will change into an overload +end --[[HH-- tricky: we sort of bypass the parser and directly feed all into @@ -39,9 +53,6 @@ local stringformat = string.format local stringis_empty = string.is_empty local mathceil = math.ceil ---- TODO an option to dump the default features for a script would make ---- a nice addition to luaotfload-tool - local defaults = { dflt = { "ccmp", "locl", "rlig", "liga", "clig", @@ -1185,20 +1196,21 @@ local handle_request = function (specification) --- The next line sets the “rand” feature to “random”; I haven’t --- investigated it any further (luatex-fonts-ext), so it will --- just stay here. - specification.features.normal - = fonts.handlers.otf.features.normalize(request.features) + specification.features.normal = normalize (request.features) return specification end -local compare_requests = function (spec) - local old = old_behavior(spec) - local new = handle_request(spec) - return new +if as_script == true then --- skip the remainder of the file + fonts.names.handle_request = handle_request + report ("log", 5, "load", + "Exiting early from luaotfload-features.lua.") + return +else + local registersplit = definers.registersplit + registersplit (":", handle_request, "cryptic") + registersplit ("", handle_request, "more cryptic") -- catches \font\text=[names] end -fonts.definers.registersplit(":", handle_request, "cryptic") -fonts.definers.registersplit("", handle_request, "more cryptic") -- catches \font\text=[names] - ---[[ end included font-ltx.lua ]] --[[doc-- |