diff options
author | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2009-10-07 18:23:43 +0000 |
---|---|---|
committer | Manuel Pégourié-Gonnard <mpg@elzevir.fr> | 2009-10-07 18:23:43 +0000 |
commit | 89f05f1b7ae3cad4245b1d75f9ed441bc1634a6e (patch) | |
tree | 7f9881e5d48a2d2d4c0ddcc745289516fc2f39cd /Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua | |
parent | 3a745b929d845d22a7193019f07d2503c01f4f00 (diff) |
context-simplefonts update
git-svn-id: svn://tug.org/texlive/trunk@15675 c570f23f-e606-0410-a88d-b1316a301751
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.lua | 52 |
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 |