summaryrefslogtreecommitdiff
path: root/tex/context/modules/mkiv/s-fonts-system.lua
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-05-17 19:31:15 +0200
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-05-17 19:31:15 +0200
commit2017d30b4ca772c8eeac4fc0eb9b54e547a9a1d8 (patch)
treed96df31f305a095c078ea5fb9f639ca34ac36c12 /tex/context/modules/mkiv/s-fonts-system.lua
parent53ff76b73cd1f373ecdfb0f7f17df6f352621d6e (diff)
downloadcontext-2017d30b4ca772c8eeac4fc0eb9b54e547a9a1d8.tar.gz
2016-05-17 19:25:00
Diffstat (limited to 'tex/context/modules/mkiv/s-fonts-system.lua')
-rw-r--r--tex/context/modules/mkiv/s-fonts-system.lua69
1 files changed, 69 insertions, 0 deletions
diff --git a/tex/context/modules/mkiv/s-fonts-system.lua b/tex/context/modules/mkiv/s-fonts-system.lua
new file mode 100644
index 000000000..5b58a4a53
--- /dev/null
+++ b/tex/context/modules/mkiv/s-fonts-system.lua
@@ -0,0 +1,69 @@
+if not modules then modules = { } end modules ['s-fonts-system'] = {
+ version = 1.001,
+ comment = "companion to s-fonts-system.mkiv",
+ author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
+ copyright = "PRAGMA ADE / ConTeXt Development Team",
+ license = "see context related readme files"
+}
+
+-- ["zapfinoforteltpro"]={
+-- ["designsize"]=0,
+-- ["filename"]="zapfinoforteltpro.otf",
+-- ["fontname"]="zapfinoforteltpro",
+-- ["fontweight"]="regular",
+-- ["family"]="zapfinoforteltpro",
+-- ["subfamily"]="regular",
+-- ["familyname"]="zapfinoforteltpro",
+-- ["subfamilyname"]="regular",
+-- ["format"]="otf",
+-- ["fullname"]="zapfinoforteltpro",
+-- ["maxsize"]=0,
+-- ["minsize"]=0,
+-- ["modification"]=1105543074,
+-- ["rawname"]="ZapfinoForteLTPro",
+-- ["style"]="normal",
+-- ["variant"]="normal",
+-- ["weight"]="normal",
+-- ["width"]="normal",
+-- }
+
+moduledata.fonts = moduledata.fonts or { }
+moduledata.fonts.system = moduledata.fonts.system or { }
+
+local lower = string.lower
+
+local context = context
+local NC, NR, HL = context.NC, context.NR, context.HL
+local bold = context.bold
+
+function moduledata.fonts.system.showinstalled(specification)
+ specification = interfaces.checkedspecification(specification)
+ local pattern = lower(specification.pattern or "")
+ local list = fonts.names.list(pattern,false,true)
+ if list then
+ local files = { }
+ for k, v in next, list do
+ files[file.basename(string.lower(v.filename))] = v
+ end
+ context.starttabulate { "|Tl|Tl|Tl|Tl|Tl|Tl|" }
+ HL()
+ NC() bold("filename")
+ NC() bold("fontname")
+ NC() bold("subfamily")
+ NC() bold("variant")
+ NC() bold("weight")
+ NC() bold("width")
+ NC() NR()
+ HL()
+ for filename, data in table.sortedpairs(files) do
+ NC() context(filename)
+ NC() context(data.fontname)
+ NC() context(data.subfamily)
+ NC() context(data.variant)
+ NC() context(data.weight)
+ NC() context(data.width)
+ NC() NR()
+ end
+ context.stoptabulate()
+ end
+end