summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/font-imp-quality.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/mkiv/font-imp-quality.lua')
-rw-r--r--tex/context/base/mkiv/font-imp-quality.lua49
1 files changed, 34 insertions, 15 deletions
diff --git a/tex/context/base/mkiv/font-imp-quality.lua b/tex/context/base/mkiv/font-imp-quality.lua
index 01f0afe63..56e91df99 100644
--- a/tex/context/base/mkiv/font-imp-quality.lua
+++ b/tex/context/base/mkiv/font-imp-quality.lua
@@ -153,15 +153,11 @@ registerafmfeature(specification)
fonts.goodies.register("expansions", function(...) return fonts.goodies.report("expansions", trace_expansion, ...) end)
-if context then
-
- implement {
- name = "setupfontexpansion",
- arguments = "2 strings",
- actions = function(class,settings) getparameters(classes,class,'preset',settings) end
- }
-
-end
+implement {
+ name = "setupfontexpansion",
+ arguments = "2 strings",
+ actions = function(class,settings) getparameters(classes,class,'preset',settings) end
+}
-- -- -- -- -- --
-- protrusion
@@ -516,12 +512,35 @@ registerafmfeature(specification)
fonts.goodies.register("protrusions", function(...) return fonts.goodies.report("protrusions", trace_protrusion, ...) end)
-if context then
+implement {
+ name = "setupfontprotrusion",
+ arguments = "2 strings",
+ actions = function(class,settings) getparameters(classes,class,'preset',settings) end
+}
+
+local function initialize(tfmdata,value)
+ local properties = tfmdata.properties
+ if properties then
+ value = tonumber(value)
+ if value then
+ if value < 5 then
+ value = 5
+ elseif value > 100 then
+ value = 100
+ end
+ end
+ properties.threshold = value or nil -- nil enforces default
+ end
+end
- implement {
- name = "setupfontprotrusion",
- arguments = "2 strings",
- actions = function(class,settings) getparameters(classes,class,'preset',settings) end
+local specification = {
+ name = "threshold",
+ description = "threshold for quality features",
+ initializers = {
+ base = initialize,
+ node = initialize,
}
+}
-end
+registerotffeature(specification)
+registerafmfeature(specification)