summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua')
-rw-r--r--Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua21
1 files changed, 20 insertions, 1 deletions
diff --git a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua
index d4e3244a94a..2b2aa1dfc35 100644
--- a/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua
+++ b/Master/texmf-dist/tex/context/modules/mkiv/s-fonts-variable.lua
@@ -23,6 +23,7 @@ function moduledata.fonts.variable.showvariations(specification)
specification = interfaces.checkedspecification(specification)
local fontfile = specification.font
+ local maximum = tonumber(specification.max) or 0xFFFF
local fontname = format("testfont-%s",i)
local fontsize = tex.dimen.bodyfontsize
if not fontfile then
@@ -51,6 +52,10 @@ function moduledata.fonts.variable.showvariations(specification)
-- return
-- end
+if not fontdata.shared.rawdata.metadata.fullname then
+ fontdata.shared.rawdata.metadata.fullname = fontdata.shared.rawdata.metadata.fontname
+end
+
context.starttitle { title = fontdata.shared.rawdata.metadata.fullname }
local parameters = fontdata.parameters
@@ -224,16 +229,30 @@ function moduledata.fonts.variable.showvariations(specification)
end
context.stopsubject()
+ local sample = specification.sample
+
for i=1,#collected do
local instance = collected[i]
context.startsubject { title = instance }
context.start()
context.definedfont { "name:" .. instance .. "*default" }
- context.input("zapf.tex")
+ if sample and sample ~= "" then
+ context(sample)
+ else
+ context.input("zapf.tex")
+ end
context.par()
context.stop()
context.stopsubject()
+
+ if i > maximum then
+ context.startsubject { title = "And so on" }
+ context("no more than %i instances are shown",maximum)
+ context.par()
+ context.stopsubject()
+ break
+ end
end
-- local function showregions(tag)