diff options
author | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-17 19:31:15 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2016-05-17 19:31:15 +0200 |
commit | 2017d30b4ca772c8eeac4fc0eb9b54e547a9a1d8 (patch) | |
tree | d96df31f305a095c078ea5fb9f639ca34ac36c12 /tex/context/base/mkiv/font-mis.lua | |
parent | 53ff76b73cd1f373ecdfb0f7f17df6f352621d6e (diff) | |
download | context-2017d30b4ca772c8eeac4fc0eb9b54e547a9a1d8.tar.gz |
2016-05-17 19:25:00
Diffstat (limited to 'tex/context/base/mkiv/font-mis.lua')
-rw-r--r-- | tex/context/base/mkiv/font-mis.lua | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/font-mis.lua b/tex/context/base/mkiv/font-mis.lua new file mode 100644 index 000000000..d359e2132 --- /dev/null +++ b/tex/context/base/mkiv/font-mis.lua @@ -0,0 +1,51 @@ +if not modules then modules = { } end modules ['font-mis'] = { + version = 1.001, + comment = "companion to mtx-fonts", + author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", + copyright = "PRAGMA ADE / ConTeXt Development Team", + license = "see context related readme files" +} + +fonts = fonts or { } + +fonts.helpers = fonts.helpers or { } +local helpers = fonts.helpers + +fonts.handlers = fonts.handlers or { } +local handlers = fonts.handlers + +handlers.otf = handlers.otf or { } +local otf = handlers.otf + +local readers = otf.readers + +if readers then + + otf.version = otf.version or 3.020 + otf.cache = otf.cache or containers.define("fonts", "otl", otf.version, true) + + function fonts.helpers.getfeatures(name,save) + local filename = resolvers.findfile(name) or "" + if filename ~= "" then + local name = file.removesuffix(file.basename(filename)) + local cleanname = containers.cleanname(name) + local data = containers.read(otf.cache,cleanname) + if data then + readers.unpack(data) + else + data = readers.loadfont(filename) + if data and save then + containers.write(otf.cache,cleanname,data) + end + end + return data and data.resources and data.resources.features + end + end + +else + + function fonts.helpers.getfeatures(name) + -- not supported + end + +end |