diff options
author | Marius <mariausol@gmail.com> | 2013-05-19 20:40:34 +0300 |
---|---|---|
committer | Marius <mariausol@gmail.com> | 2013-05-19 20:40:34 +0300 |
commit | 13ec4b540e0d46c97fd7b089e0b7413da81e0a9f (patch) | |
tree | bebfa563a17c06b3bd3bf8f6f4ba6d025e00d107 /tex/context/base/s-fonts-vectors.lua | |
parent | 69ad13650cda027526271179e95b5294694143a1 (diff) | |
download | context-13ec4b540e0d46c97fd7b089e0b7413da81e0a9f.tar.gz |
beta 2013.05.19 19:27
Diffstat (limited to 'tex/context/base/s-fonts-vectors.lua')
-rw-r--r-- | tex/context/base/s-fonts-vectors.lua | 208 |
1 files changed, 104 insertions, 104 deletions
diff --git a/tex/context/base/s-fonts-vectors.lua b/tex/context/base/s-fonts-vectors.lua index 1bac0ae8b..436f3e63d 100644 --- a/tex/context/base/s-fonts-vectors.lua +++ b/tex/context/base/s-fonts-vectors.lua @@ -1,104 +1,104 @@ -if not modules then modules = { } end modules ['s-fonts-vectors'] = { - version = 1.001, - comment = "companion to s-fonts-vectors.mkiv", - author = "Hans Hagen, PRAGMA-ADE, Hasselt NL", - copyright = "PRAGMA ADE / ConTeXt Development Team", - license = "see context related readme files" -} - -moduledata.fonts = moduledata.fonts or { } -moduledata.fonts.protrusions = moduledata.fonts.protrusions or { } -moduledata.fonts.expansions = moduledata.fonts.expansions or { } - -local NC, NR = context.NC, context.NR - -local classes = fonts.protrusions.classes -local vectors = fonts.protrusions.vectors - -function moduledata.fonts.protrusions.showvector(specification) - specification = interfaces.checkedspecification(specification) - local vector = vectors[specification.name or "?"] - if vector then - context.blank() - context.startcolumns { n = specification.columns or 3 } - context.starttabulate { "|T||cw(.5em)||" } - for unicode, values in table.sortedhash(vector) do - NC() context("%U",unicode) - NC() context("%.02f",values[1]) - NC() context("%c",unicode) - NC() context("%.02f",values[2]) - NC() NR() - end - context.stoptabulate() - context.stopcolumns() - context.blank() - end -end - -function moduledata.fonts.protrusions.showclass(specification) - specification = interfaces.checkedspecification(specification) - local class = specification.name and classes[specification.name] - local classes = class and { class} or classes - context.starttabulate { "|l|l|r|r|r|" } - NC() context.bold("name") - NC() context.bold("vector") - NC() context.bold("factor") - NC() context.bold("left") - NC() context.bold("right") - NC() NR() - for name, class in table.sortedhash(classes) do - NC() context(name) - NC() context(class.vector) - NC() context("%.02f",class.factor) - NC() context("%.02f",class.left) - NC() context("%.02f",class.right) - NC() NR() - end - context.stoptabulate() -end - -local classes = fonts.expansions.classes -local vectors = fonts.expansions.vectors - -function moduledata.fonts.expansions.showvector(specification) - specification = interfaces.checkedspecification(specification) - local vector = vectors[specification.name or "?"] - if vector then - context.blank() - context.startcolumns { n = specification.columns or 3 } - context.starttabulate { "|T|cw(.5em)||" } - for unicode, value in table.sortedhash(vector) do - NC() context("%U",unicode) - NC() context("%c",unicode) - NC() context("%.02f",value) - NC() NR() - end - context.stoptabulate() - context.stopcolumns() - context.blank() - end -end - -function moduledata.fonts.expansions.showclass(specification) - specification = interfaces.checkedspecification(specification) - local class = specification.name and classes[specification.name] - local classes = class and { class} or classes - context.starttabulate { "|l|l|r|r|r|" } - NC() context.bold("name") - NC() context.bold("vector") - NC() context.bold("step") - NC() context.bold("factor") - NC() context.bold("stretch") - NC() context.bold("shrink") - NC() NR() - for name, class in table.sortedhash(classes) do - NC() context(name) - NC() context(class.vector) - NC() context("%.02f",class.step) - NC() context("%.02f",class.factor) - NC() context("% 2i",class.stretch) - NC() context("% 2i",class.shrink) - NC() NR() - end - context.stoptabulate() -end +if not modules then modules = { } end modules ['s-fonts-vectors'] = {
+ version = 1.001,
+ comment = "companion to s-fonts-vectors.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+moduledata.fonts = moduledata.fonts or { }
+moduledata.fonts.protrusions = moduledata.fonts.protrusions or { }
+moduledata.fonts.expansions = moduledata.fonts.expansions or { }
+
+local NC, NR = context.NC, context.NR
+
+local classes = fonts.protrusions.classes
+local vectors = fonts.protrusions.vectors
+
+function moduledata.fonts.protrusions.showvector(specification)
+ specification = interfaces.checkedspecification(specification)
+ local vector = vectors[specification.name or "?"]
+ if vector then
+ context.blank()
+ context.startcolumns { n = specification.columns or 3 }
+ context.starttabulate { "|T||cw(.5em)||" }
+ for unicode, values in table.sortedhash(vector) do
+ NC() context("%U",unicode)
+ NC() context("%.02f",values[1])
+ NC() context("%c",unicode)
+ NC() context("%.02f",values[2])
+ NC() NR()
+ end
+ context.stoptabulate()
+ context.stopcolumns()
+ context.blank()
+ end
+end
+
+function moduledata.fonts.protrusions.showclass(specification)
+ specification = interfaces.checkedspecification(specification)
+ local class = specification.name and classes[specification.name]
+ local classes = class and { class} or classes
+ context.starttabulate { "|l|l|r|r|r|" }
+ NC() context.bold("name")
+ NC() context.bold("vector")
+ NC() context.bold("factor")
+ NC() context.bold("left")
+ NC() context.bold("right")
+ NC() NR()
+ for name, class in table.sortedhash(classes) do
+ NC() context(name)
+ NC() context(class.vector)
+ NC() context("%.02f",class.factor)
+ NC() context("%.02f",class.left)
+ NC() context("%.02f",class.right)
+ NC() NR()
+ end
+ context.stoptabulate()
+end
+
+local classes = fonts.expansions.classes
+local vectors = fonts.expansions.vectors
+
+function moduledata.fonts.expansions.showvector(specification)
+ specification = interfaces.checkedspecification(specification)
+ local vector = vectors[specification.name or "?"]
+ if vector then
+ context.blank()
+ context.startcolumns { n = specification.columns or 3 }
+ context.starttabulate { "|T|cw(.5em)||" }
+ for unicode, value in table.sortedhash(vector) do
+ NC() context("%U",unicode)
+ NC() context("%c",unicode)
+ NC() context("%.02f",value)
+ NC() NR()
+ end
+ context.stoptabulate()
+ context.stopcolumns()
+ context.blank()
+ end
+end
+
+function moduledata.fonts.expansions.showclass(specification)
+ specification = interfaces.checkedspecification(specification)
+ local class = specification.name and classes[specification.name]
+ local classes = class and { class} or classes
+ context.starttabulate { "|l|l|r|r|r|" }
+ NC() context.bold("name")
+ NC() context.bold("vector")
+ NC() context.bold("step")
+ NC() context.bold("factor")
+ NC() context.bold("stretch")
+ NC() context.bold("shrink")
+ NC() NR()
+ for name, class in table.sortedhash(classes) do
+ NC() context(name)
+ NC() context(class.vector)
+ NC() context("%.02f",class.step)
+ NC() context("%.02f",class.factor)
+ NC() context("% 2i",class.stretch)
+ NC() context("% 2i",class.shrink)
+ NC() NR()
+ end
+ context.stoptabulate()
+end
|