summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-ctx.lua
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2019-12-12 20:13:50 +0100
committerContext Git Mirror Bot <phg@phi-gamma.net>2019-12-12 20:13:50 +0100
commit2683d42fe95c59c52a9d7c334292d0a5a15c030a (patch)
tree5ada28813a58ae1acea3fddf5f6a2e185d739c17 /tex/context/base/mkiv/font-ctx.lua
parent989909187ebdac48c8cbc65a99840ed58d3f4f46 (diff)
downloadcontext-2683d42fe95c59c52a9d7c334292d0a5a15c030a.tar.gz
2019-12-12 19:34:00
Diffstat (limited to 'tex/context/base/mkiv/font-ctx.lua')
-rw-r--r--tex/context/base/mkiv/font-ctx.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/font-ctx.lua b/tex/context/base/mkiv/font-ctx.lua
index f6c81e76d..ca02d28cf 100644
--- a/tex/context/base/mkiv/font-ctx.lua
+++ b/tex/context/base/mkiv/font-ctx.lua
@@ -176,6 +176,26 @@ constructors.sharefonts = true -- experimental
constructors.nofsharedhashes = 0
constructors.nofsharedvectors = 0
constructors.noffontsloaded = 0
+constructors.autocleanup = true
+
+-- we can get rid of the tfm instance when we have fast access to the
+-- scaled character dimensions at the tex end, e.g. a fontobject.width
+-- actually we already have some of that now as virtual keys in glyphs
+--
+-- flushing the kern and ligature tables from memory saves a lot (only
+-- base mode) but it complicates vf building where the new characters
+-- demand this data .. solution: functions that access them
+
+-- font.getcopy = font.getfont -- we always want the table that context uses
+
+function constructors.cleanuptable(tfmdata)
+ if constructors.autocleanup and tfmdata.properties.virtualized then
+ for k, v in next, tfmdata.characters do
+ if v.commands then v.commands = nil end
+ -- if v.kerns then v.kerns = nil end
+ end
+ end
+end
do