summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua')
-rw-r--r--Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua52
1 files changed, 45 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua b/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua
index 8c86cc779a5..362e60916aa 100644
--- a/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua
+++ b/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua
@@ -18,6 +18,8 @@ simplefonts.fontlist = simplefonts.fontlist or { }
simplefonts.extlist = simplefonts.extlist or { }
simplefonts.parameters = simplefonts.parameters or { }
simplefonts.features = simplefonts.features or { }
+simplefonts.scripts = simplefonts.scripts or { }
+simplefonts.languages = simplefonts.languages or { }
simplefonts.fontlist = {
["hiraginokakugothicpro"] = -- Hiragino Kaku Gothic Pro
@@ -195,15 +197,51 @@ function simplefonts.normalizefontname(name)
texsprint(ctxcatcodes,fontname)
end
+for k,v in next, fonts.otf.tables.features do
+ simplefonts.features[v] = k
+ simplefonts.features[lower(v)] = k
+ simplefonts.features[lower(gsub(v,"[^a-zA-Z0-9]",""))] = k
+end
+
+for k,v in next, fonts.otf.tables.scripts do
+ simplefonts.scripts[v] = k
+ simplefonts.scripts[lower(v)] = k
+ simplefonts.scripts[lower(gsub(v,"[^a-zA-Z0-9]",""))] = k
+end
+
+for k, v in next, fonts.otf.tables.languages do
+ simplefonts.languages[v] = k
+ simplefonts.languages[lower(v)] = k
+ simplefonts.languages[lower(gsub(v,"[^a-zA-Z0-9]",""))] = k
+end
+
function simplefonts.parameter(key,value,list)
- local features = fonts.otf.tables.to_features[key]
- local parameters = simplefonts.parameters[key]
- if features then
- texsprint(format("\\addvalue{%s}{%s=%s}",list,features,value))
- --~ print(features .. "=" .. value)
+ local feature = simplefonts.features [key]
+ local script = simplefonts.scripts [value]
+ local language = simplefonts.languages [value]
+ local parameter = simplefonts.parameters[key]
+ if feature then
+ texsprint(format("\\addvalue{%s}{%s=%s}",list,feature,value))
+ --~ print("feature: " .. feature .. " = " .. value)
else
- if not parameters then
- interfaces.showmessage("simplefonts","2",key)
+ if key == "script" then
+ if script then
+ texsprint(format("\\addvalue{%s}{%s=%s}",list,key,script))
+ --~ print("script: " script)
+ else
+ interfaces.showmessage("simplefonts","4",value)
+ end
+ elseif key == "language" then
+ if language then
+ texsprint(format("\\addvalue{%s}{%s=%s}",list,key,language))
+ --~ print("language: " language)
+ else
+ interfaces.showmessage("simplefonts","5",value)
+ end
+ else
+ if not parameter then
+ interfaces.showmessage("simplefonts","2",key)
+ end
end
end
end