summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-otl.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2017-04-16 13:20:40 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2017-04-16 13:20:40 +0200
commit218228536ed709be8ab2dde4a00dc27249ceed8a (patch)
tree71b331e3d99ebd89fefcc1cb369d233c5c7fbdc1 /tex/context/base/mkiv/font-otl.lua
parentea2466fe69bd082d379e95e1567f3de0b76de243 (diff)
downloadcontext-218228536ed709be8ab2dde4a00dc27249ceed8a.tar.gz
2017-04-16 12:47:00
Diffstat (limited to 'tex/context/base/mkiv/font-otl.lua')
-rw-r--r--tex/context/base/mkiv/font-otl.lua30
1 files changed, 25 insertions, 5 deletions
diff --git a/tex/context/base/mkiv/font-otl.lua b/tex/context/base/mkiv/font-otl.lua
index 9e4e255e3..c0b152a5b 100644
--- a/tex/context/base/mkiv/font-otl.lua
+++ b/tex/context/base/mkiv/font-otl.lua
@@ -53,11 +53,13 @@ local fonts = fonts
local otf = fonts.handlers.otf
otf.version = 3.028 -- beware: also sync font-mis.lua and in mtx-fonts
-otf.cache = containers.define("fonts", "otl", otf.version, true)
-otf.svgcache = containers.define("fonts", "svg", otf.version, true)
-otf.pdfcache = containers.define("fonts", "pdf", otf.version, true)
+otf.cache = containers.define("fonts", "otl", otf.version, true)
+otf.svgcache = containers.define("fonts", "svg", otf.version, true)
+otf.sbixcache = containers.define("fonts", "sbix", otf.version, true)
+otf.pdfcache = containers.define("fonts", "pdf", otf.version, true)
otf.svgenabled = false
+otf.sbixenabled = false
local otfreaders = otf.readers
@@ -127,8 +129,10 @@ function otf.load(filename,sub,instance)
starttiming(otfreaders)
data = otfreaders.loadfont(filename,sub or 1,instance) -- we can pass the number instead (if it comes from a name search)
if data then
- local resources = data.resources
- local svgshapes = resources.svgshapes
+ -- todo: make this a plugin
+ local resources = data.resources
+ local svgshapes = resources.svgshapes
+ local sbixshapes = resources.sbixshapes
if svgshapes then
resources.svgshapes = nil
if otf.svgenabled then
@@ -144,6 +148,22 @@ function otf.load(filename,sub,instance)
}
end
end
+ if sbixshapes then
+ resources.sbixshapes = nil
+ if otf.sbixenabled then
+ local timestamp = os.date()
+ -- work in progress ... a bit boring to do
+ containers.write(otf.sbixcache,hash, {
+ sbixshapes = sbixshapes,
+ timestamp = timestamp,
+ })
+ data.properties.sbix = {
+ hash = hash,
+ timestamp = timestamp,
+ }
+ end
+ end
+ --
otfreaders.compact(data)
otfreaders.rehash(data,"unicodes")
otfreaders.addunicodetable(data)