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 | |
parent | 3a745b929d845d22a7193019f07d2503c01f4f00 (diff) |
context-simplefonts update
git-svn-id: svn://tug.org/texlive/trunk@15675 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master')
-rw-r--r-- | Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua | 52 | ||||
-rw-r--r-- | Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.tex | 4 |
2 files changed, 48 insertions, 8 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 diff --git a/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.tex b/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.tex index c345ca4dfa8..ee983ab3855 100644 --- a/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.tex +++ b/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.tex @@ -1,6 +1,6 @@ %D \module %D [ file=t-simplefonts, -%D version=2009.09.20, +%D version=2009.10.06, %D title=\CONTEXT\ User Module, %D subtitle=Simplefonts, %D author=Wolfgang Schuster, @@ -113,6 +113,8 @@ \setinterfacemessage{simplefonts}{1} {font '--' not found} \setinterfacemessage{simplefonts}{2} {feature '--' is not defined} \setinterfacemessage{simplefonts}{3} {your context is too old, you use you need at last version '--'} + \setinterfacemessage{simplefonts}{4} {script '--' is not defined} + \setinterfacemessage{simplefonts}{5} {language '--' is not defined} \stopinterface %D Module setup |