diff options
author | Hans Hagen <pragma@wxs.nl> | 2017-05-09 11:20:37 +0200 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2017-05-09 11:20:37 +0200 |
commit | 2498bbe606e7cca22799e33dc29ae5160693b3d8 (patch) | |
tree | 2e71bea973ba924760facb782342ed063ab096e2 /tex/context/modules/mkiv/s-fonts-variable.lua | |
parent | 57c3891a6b93b57f91ea77c9bbecffacbcc0da28 (diff) | |
download | context-2498bbe606e7cca22799e33dc29ae5160693b3d8.tar.gz |
2017-05-09 10:20:00
Diffstat (limited to 'tex/context/modules/mkiv/s-fonts-variable.lua')
-rw-r--r-- | tex/context/modules/mkiv/s-fonts-variable.lua | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/tex/context/modules/mkiv/s-fonts-variable.lua b/tex/context/modules/mkiv/s-fonts-variable.lua index d4e3244a9..2b2aa1dfc 100644 --- a/tex/context/modules/mkiv/s-fonts-variable.lua +++ b/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) |