summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Master/texmf-dist/doc/context/third/simplefonts/simplefonts.pdfbin67868 -> 49696 bytes
-rw-r--r--Master/texmf-dist/source/context/third/simplefonts/doc/simplefonts.tex4
-rw-r--r--Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua156
-rw-r--r--Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.tex276
4 files changed, 160 insertions, 276 deletions
diff --git a/Master/texmf-dist/doc/context/third/simplefonts/simplefonts.pdf b/Master/texmf-dist/doc/context/third/simplefonts/simplefonts.pdf
index 8bcb996910c..f929a0dbff7 100644
--- a/Master/texmf-dist/doc/context/third/simplefonts/simplefonts.pdf
+++ b/Master/texmf-dist/doc/context/third/simplefonts/simplefonts.pdf
Binary files differ
diff --git a/Master/texmf-dist/source/context/third/simplefonts/doc/simplefonts.tex b/Master/texmf-dist/source/context/third/simplefonts/doc/simplefonts.tex
index 27f588f22a6..cbc5e27e14c 100644
--- a/Master/texmf-dist/source/context/third/simplefonts/doc/simplefonts.tex
+++ b/Master/texmf-dist/source/context/third/simplefonts/doc/simplefonts.tex
@@ -1,4 +1,4 @@
-\usemodule[simplefonts][size=11pt]
+\usemodule[simplefonts]%[size=11pt]
\setmainfont[DejaVu Serif]
\setsansfont[DejaVu Sans]
@@ -35,7 +35,7 @@ for _, style in global.ipairs(styles) do
tex.sprint(tex.ctxcatcodes,"\\NC " .. style .. "\\NC ")
for _, extension in global.ipairs(thirddata.simplefonts.extlist["normal"][style]) do
tex.sprint(tex.ctxcatcodes,extension .. " ")
- global.print(extension)
+-- global.print(extension)
end
tex.sprint(tex.ctxcatcodes," \\NC\\NR")
end
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 d920fe4242d..8c86cc779a5 100644
--- a/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua
+++ b/Master/texmf-dist/tex/context/third/simplefonts/t-simplefonts.lua
@@ -142,151 +142,9 @@ simplefonts.fontlist = {
} ,
}
---~ for k,v in next, global.fonts.otf.tables.features do
---~ v = lower(gsub(gsub(gsub(v,"#",""),"-","")," ",""))
---~ simplefonts.features[v] = lower(gsub(k," ",""))
---~ end
-
-simplefonts.features = {
- ['accessallalternates'] = 'aalt',
- ['abovebaseforms'] = 'abvf',
- ['abovebasemarkpositioning'] = 'abvm',
- ['abovebasesubstitutions'] = 'abvs',
- ['alternativefractions'] = 'afrc',
- ['akhands'] = 'akhn',
- ['belowbaseforms' ] = 'blwf',
- ['belowbasemarkpositioning'] = 'blwm',
- ['belowbasesubstitutions'] = 'blws',
- ['petitecapitalsfromcapitals'] = 'c2pc',
- ['smallcapitalsfromcapitals'] = 'c2sc',
- ['contextualalternates'] = 'calt',
- ['casesensitiveforms'] = 'case',
- ['glyphcompositiondecomposition'] = 'ccmp',
- ['conjunctforms'] = 'cjct',
- ['contextualligatures'] = 'clig',
- ['capitalspacing'] = 'cpsp',
- ['contextualswash'] = 'cswh',
- ['cursivepositioning'] = 'curs',
- ['defaultprocessing'] = 'dflt',
- ['distances'] = 'dist',
- ['discretionaryligatures'] = 'dlig',
- ['denominators'] = 'dnom',
- ['dotlessforms'] = 'dtls',
- ['expertforms'] = 'expt',
- ['finalglyphalternates'] = 'falt',
- ['terminalforms2'] = 'fin2',
- ['terminalforms3'] = 'fin3',
- ['terminalforms'] = 'fina',
- ['flattenedaccentsovercapitals'] = 'flac',
- ['fractions'] = 'frac',
- ['fullwidth'] = 'fwid',
- ['halfforms'] = 'half',
- ['halantforms'] = 'haln',
- ['alternatehalfwidth'] = 'halt',
- ['historicalforms'] = 'hist',
- ['horizontalkanaalternates'] = 'hkna',
- ['historicalligatures'] = 'hlig',
- ['hangul'] = 'hngl',
- ['hojokanjiforms'] = 'hojo',
- ['halfwidth'] = 'hwid',
- ['initialforms'] = 'init',
- ['isolatedforms'] = 'isol',
- ['italics'] = 'ital',
- ['justificationalternatives'] = 'jalt',
- ['jis2004forms'] = 'jp04',
- ['jis78forms'] = 'jp78',
- ['jis83forms'] = 'jp83',
- ['jis90forms'] = 'jp90',
- ['kerning'] = 'kern',
- ['leftbounds'] = 'lfbd',
- ['standardligatures'] = 'liga',
- ['leadingjamoforms'] = 'ljmo',
- ['liningfigures'] = 'lnum',
- ['localizedforms'] = 'locl',
- ['markpositioning'] = 'mark',
- ['medialforms2'] = 'med2',
- ['medialforms'] = 'medi',
- ['mathematicalgreek'] = 'mgrk',
- ['marktomarkpositioning'] = 'mkmk',
- ['markpositioningviasubstitution'] = 'mset',
- ['alternateannotationforms'] = 'nalt',
- ['nlckanjiforms'] = 'nlck',
- ['nuktaforms'] = 'nukt',
- ['numerators'] = 'numr',
- ['oldstylefigures'] = 'onum',
- ['opticalbounds'] = 'opbd',
- ['ordinals'] = 'ordn',
- ['ornaments'] = 'ornm',
- ['proportionalalternatewidth'] = 'palt',
- ['petitecapitals'] = 'pcap',
- ['proportionalfigures'] = 'pnum',
- ['prebaseforms'] = 'pref',
- ['prebasesubstitutions'] = 'pres',
- ['postbaseforms'] = 'pstf',
- ['postbasesubstitutions'] = 'psts',
- ['proportionalwidths'] = 'pwid',
- ['quarterwidths'] = 'qwid',
- ['randomize'] = 'rand',
- ['rakarforms'] = 'rkrf',
- ['requiredligatures'] = 'rlig',
- ['rephform'] = 'rphf',
- ['rightbounds'] = 'rtbd',
- ['righttoleftalternates'] = 'rtla',
- ['rubynotationforms'] = 'ruby',
- ['stylisticalternates'] = 'salt',
- ['scientificinferiors'] = 'sinf',
- ['opticalsize'] = 'size',
- ['smallcapitals'] = 'smcp',
- ['simplifiedforms'] = 'smpl',
- ['stylisticset1'] = 'ss01',
- ['stylisticset2'] = 'ss02',
- ['stylisticset3'] = 'ss03',
- ['stylisticset4'] = 'ss04',
- ['stylisticset5'] = 'ss05',
- ['stylisticset6'] = 'ss06',
- ['stylisticset7'] = 'ss07',
- ['stylisticset8'] = 'ss08',
- ['stylisticset9'] = 'ss09',
- ['stylisticset10'] = 'ss10',
- ['stylisticset11'] = 'ss11',
- ['stylisticset12'] = 'ss12',
- ['stylisticset13'] = 'ss13',
- ['stylisticset14'] = 'ss14',
- ['stylisticset15'] = 'ss15',
- ['stylisticset16'] = 'ss16',
- ['stylisticset17'] = 'ss17',
- ['stylisticset18'] = 'ss18',
- ['stylisticset19'] = 'ss19',
- ['stylisticset20'] = 'ss20',
- ['scriptstyle'] = 'ssty',
- ['subscript'] = 'subs',
- ['superscript'] = 'sups',
- ['swash'] = 'swsh',
- ['titling'] = 'titl',
- ['trailingjamoforms'] = 'tjmo',
- ['traditionalnameforms'] = 'tnam',
- ['tabularfigures'] = 'tnum',
- ['traditionalforms'] = 'trad',
- ['thirdeidths'] = 'twid',
- ['unicase'] = 'unic',
- ['alternateverticalmetrics'] = 'valt',
- ['vattuvariants'] = 'vatu',
- ['verticalwriting'] = 'vert',
- ['alternateverticalhalfmetrics'] = 'vhal',
- ['voweljamoforms'] = 'vjmo',
- ['verticalkanaalternates'] = 'vkna',
- ['verticalkerning'] = 'vkrn',
- ['proportionalalternateverticalmetrics'] = 'vpal',
- ['verticalrotation'] = 'vrt2',
- ['slashedzero'] = 'zero',
- -- context only features
- ['traditionaltexreplacements'] = 'trep',
- ['traditionaltexligatures'] = 'tlig',
-}
-
function simplefonts.selectfont(font,name,extension,style,weight)
local fontname = {}
- local name = lower(gsub(gsub(name," ",""),"-",""))
+ local name = lower(gsub(name,"[^a-zA-Z0-9]",""))
if extension ~= "" then
ext = find(extension,"*")
if ext ~= nil then
@@ -294,7 +152,7 @@ function simplefonts.selectfont(font,name,extension,style,weight)
else
fontname = extension
end
- fontname = "name:" .. lower(gsub(fontname," ",""))
+ fontname = "name:" .. lower(gsub(fontname,"[^a-zA-Z0-9]",""))
else
if simplefonts.fontlist[name] then
if simplefonts.fontlist[name][weight] then
@@ -319,7 +177,7 @@ function simplefonts.selectfont(font,name,extension,style,weight)
fontname = "name:" .. fontname
break
else
- --~ texsprint(prtcatcodes,format("\\showmessage\\m!simplefonts{1}{%s}",fontname))
+ --~ interfaces.showmessage("simplefonts","1",fontname) -- wrong place
fontname = "DefaultFont" -- no font is found
end
end
@@ -327,25 +185,25 @@ function simplefonts.selectfont(font,name,extension,style,weight)
end
--~ print(fontname)
if fontname == "DefaultFont" then
- texsprint(prtcatcodes,format("\\showmessage\\m!simplefonts{1}{%s}",name))
+ interfaces.showmessage("simplefonts","1",name)
end
texsprint(prtcatcodes,format("\\setvalue{\\????sf %s%s}{%s}",font,style,fontname))
end
function simplefonts.normalizefontname(name)
- local fontname = lower(gsub(gsub(name," ",""),"-","")) -- remove spaces and hyphens from the user specified name
+ local fontname = lower(gsub(name,"[^a-zA-Z0-9]","")) -- remove spaces and hyphens etc. from the user specified name
texsprint(ctxcatcodes,fontname)
end
function simplefonts.parameter(key,value,list)
- local features = simplefonts.features[key]
+ 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)
else
if not parameters then
- texsprint(prtcatcodes,format("\\showmessage\\m!simplefonts{2}{%s}",key))
+ interfaces.showmessage("simplefonts","2",key)
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 3f9ecc026fe..cb542301f2d 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.08.01,
+%D version=2009.09.15,
%D title=\CONTEXT\ User Module,
%D subtitle=Simplefonts,
%D author=Wolfgang Schuster,
@@ -13,6 +13,8 @@
\unprotect
+\startmodule[simplefonts]
+
%D Constants and variables
\startinterface all
@@ -32,6 +34,18 @@
\setinterfaceconstant {range} {range}
\setinterfaceconstant {weight} {weight}
\setinterfaceconstant {features} {features}
+ \setinterfaceconstant {regularfont} {regularfont}
+ \setinterfaceconstant {italicfont} {italicfont}
+ \setinterfaceconstant {slantedfont} {slantedfont}
+ \setinterfaceconstant {boldfont} {boldfont}
+ \setinterfaceconstant {bolditalicfont} {bolditalicfont}
+ \setinterfaceconstant {boldslantedfont} {boldslantedfont}
+ \setinterfaceconstant {capsfont} {capsfont}
+ \setinterfaceconstant {italiccapsfont} {italiccapsfont}
+ \setinterfaceconstant {slantedcapsfont} {slantedcapsfont}
+ \setinterfaceconstant {boldcapsfont} {boldcapsfont}
+ \setinterfaceconstant {bolditaliccapsfont} {bolditaliccapsfont}
+ \setinterfaceconstant {boldslantedcapsfont} {boldslantedcapsfont}
\setinterfaceconstant {regularfeatures} {regularfeatures}
\setinterfaceconstant {italicfeatures} {italicfeatures}
\setinterfaceconstant {slantedfeatures} {slantedfeatures}
@@ -47,7 +61,9 @@
\setinterfaceconstant {boldslantedcapsfeatures} {boldslantedcapsfeatures}
\setinterfaceconstant {typeface} {typeface}
\setinterfaceconstant {protrusion} {protrusion}
+ \setinterfaceconstant {contextversion} {contextversion}
\setinterfaceconstant {sf} {sf}
+ \setinterfaceconstant {bc} {bc}
\stopinterface
\startinterface all
@@ -72,6 +88,7 @@
\setinterfacevariable {every} {every}
\setinterfacevariable {feature} {feature}
\setinterfacevariable {handwriting} {handwriting}
+ \setinterfacevariable {calligraphy} {calligraphy}
\setinterfacevariable {fontfamily} {fontfamily}
\stopinterface
@@ -82,30 +99,36 @@
%D System constants
\definesystemconstant {Handwriting}
-\definesystemconstant {Calligraphic}
+\definesystemconstant {Calligraphy}
\definesystemconstant {Simplefont}
-%D Lua code
+%D Messages
-\ctxloadluafile{t-simplefonts}{}
+\definemessageconstant {simplefonts}
-%D Module code
+\startinterface all
+ \setinterfacemessage{simplefonts}{title}{simplefonts}
+ \setinterfacemessage{simplefonts}{1} {font '--' not found}
+ \setinterfacemessage{simplefonts}{2} {feature '--' is not defined}
+ \setinterfacemessage{simplefonts}{3} {your context is too old, you need at last version '--'}
+\stopinterface
-\startmodule[\v!simplefonts]
+%D Module setup
\setupmodule
- [\c!size=\!!twelvepoint,
+ [\c!contextversion=2009.08.22,
+ \c!size=\!!twelvepoint,
\c!style=\c!rm]
-%D Messages
+%D Check ConTeXt version
-\definemessageconstant {simplefonts}
+\doifolderversionelse\contextversion{\currentmoduleparameter\c!contextversion}
+ {\showmessage\m!simplefonts{3}{\currentmoduleparameter\c!contextversion}\forcequitjob\v!simplefonts}
+ \donothing
-\startinterface all
- \setinterfacemessage{simplefonts}{title}{simplefonts}
- \setinterfacemessage{simplefonts}{1} {font -- not found}
- \setinterfacemessage{simplefonts}{2} {feature -- is not defined}
-\stopinterface
+%D Lua code
+
+\ctxloadluafile{t-simplefonts}{}
%D Namespace
@@ -120,6 +143,10 @@
\newif\if!!donesimplefonts
+%D Token list
+
+\newtoks\everysetupsimplefonts
+
%D Tracing
\let\enablesimplefonts \!!donesimplefontstrue
@@ -142,15 +169,17 @@
\c!italiccaps,\c!slantedcaps,\c!boldcaps,\c!bolditaliccaps,\c!boldslantedcaps}
\def\simplefonts!parameters
- {\c!regular,\c!italic,\c!slanted,\c!bold,\c!bolditalic,\c!boldslanted,\c!caps,
- \c!italiccaps,\c!slantedcaps,\c!boldcaps,\c!bolditaliccaps,\c!boldslantedcaps,
- \c!features,\c!regularfeatures,\c!italicfeatures,\c!slantedfeatures,\c!size,\c!style,
- \c!boldfeatures,\c!bolditalicfeatures,\c!boldslantedfeatures,\c!smallcapsfeatures,
- \c!capsfeatures,\c!italiccapsfeatures,\c!slantedcapsfeatures,\c!boldcapsfeatures,
- \c!bolditaliccapsfeatures,\c!boldslantedcapsfeatures,\c!weight,\c!scale,\c!range}
+ {\c!regularfont,\c!italicfont,\c!slantedfont,\c!boldfont,\c!bolditalicfont,\c!boldslantedfont,
+ \c!capsfont,\c!italiccapsfont,\c!slantedcapsfont,\c!boldcapsfont,\c!bolditaliccapsfont,
+ \c!boldslantedcapsfont,\c!features,\c!regularfeatures,\c!italicfeatures,\c!slantedfeatures,
+ \c!size,\c!style,\c!boldfeatures,\c!bolditalicfeatures,\c!boldslantedfeatures,\c!smallcapsfeatures,
+ \c!capsfeatures,\c!italiccapsfeatures,\c!slantedcapsfeatures,\c!boldcapsfeatures,\c!expansion,
+ \c!bolditaliccapsfeatures,\c!boldslantedcapsfeatures,\c!weight,\c!scale,\c!range,\c!protrusion}
%D Simplefont style
+\definefontalternative[\c!bc] % BoldCaps
+
\definefontstyle [\c!sf,\v!simplefont] [\c!sf]
\starttypescript [simplefont] [default] [size]
@@ -166,8 +195,33 @@
sl=SimplefontSlanted sa 1,
bi=SimplefontBoldItalic sa 1,
bs=SimplefontBoldSlanted sa 1,
- sc=SimplefontCaps sa 1]
+ sc=SimplefontCaps sa 1,
+ bc=SimplefontBoldCaps sa 1]
+
+\definebodyfont [default] [rm]
+ [tf=Serif sa 1,
+ bf=SerifBold sa 1,
+ it=SerifItalic sa 1,
+ sl=SerifSlanted sa 1,
+ bi=SerifBoldItalic sa 1,
+ bs=SerifBoldSlanted sa 1,
+ sc=SerifCaps sa 1,
+ bc=SerifBoldCaps sa 1]
+
+\definebodyfont [default] [ss]
+ [tf=Sans sa 1,
+ bf=SansBold sa 1,
+ it=SansItalic sa 1,
+ sl=SansSlanted sa 1,
+ bi=SansBoldItalic sa 1,
+ bs=SansBoldSlanted sa 1,
+ sc=SansCaps sa 1,
+ bc=SansBoldCaps sa 1]
+%D \macros
+%D {simplefontparameter,namedsimplefontparameter,
+%D setupsimplefonts,presetsimplefonts}
+%D
%D Internal helper macros
\def\simplefontparameter #1{\csname\????sf\currentsimplefont#1\endcsname}
@@ -181,27 +235,23 @@
\getparameters[\????sf][#1]%
\simplefonts@features{#1}\v!global
\fi
- \if!!donesimplefonts
- \doglobal\increment\simplefonts!typeface
- \simplefonts@family {\v!simplefonts:\simplefonts!typeface}%
- \simplefonts@bodyfont{\v!simplefonts:\simplefonts!typeface}%
- \fi}
+ \if!!donesimplefonts\simplefonts@bodyfont\fi}
\def\presetsimplefonts[#1]%
{\getparameters
[#1]
- [\c!regular=,
- \c!italic=,
- \c!slanted=,
- \c!bold=,
- \c!bolditalic=,
- \c!boldslanted=,
- \c!caps=,
- \c!italiccaps=,
- \c!slantedcaps=,
- \c!boldcaps=,
- \c!bolditaliccaps=,
- \c!boldslantedcaps=,
+ [\c!regularfont=,
+ \c!italicfont=,
+ \c!slantedfont=,
+ \c!boldfont=,
+ \c!bolditalicfont=,
+ \c!boldslantedfont=,
+ \c!capsfont=,
+ \c!italiccapsfont=,
+ \c!slantedcapsfont=,
+ \c!boldcapsfont=,
+ \c!bolditaliccapsfont=,
+ \c!boldslantedcapsfont=,
\c!features=\@@@@sffeatures,
\c!regularfeatures=\simplefontparameter\c!features,
\c!italicfeatures=\simplefontparameter\c!features,
@@ -219,22 +269,22 @@
\c!weight=\v!normal,
\c!scale=1.0]}
-\letvalue{\????sf:\v!style :\v!serif }\c!rm
-\letvalue{\????sf:\v!style :\v!sans }\c!ss
-\letvalue{\????sf:\v!style :\v!mono }\c!tt
-\letvalue{\????sf:\v!style :\v!math }\c!mm
-\letvalue{\????sf:\v!style :\v!handwriting }\c!hw
-\letvalue{\????sf:\v!style :\v!calligraphic}\c!cg
-\letvalue{\????sf:\v!style :\v!simplefont }\c!sf
+\letvalue{\????sf:\v!style :\v!serif }\c!rm
+\letvalue{\????sf:\v!style :\v!sans }\c!ss
+\letvalue{\????sf:\v!style :\v!mono }\c!tt
+\letvalue{\????sf:\v!style :\v!math }\c!mm
+\letvalue{\????sf:\v!style :\v!handwriting}\c!hw
+\letvalue{\????sf:\v!style :\v!calligraphy}\c!cg
+\letvalue{\????sf:\v!style :\v!simplefont }\c!sf
-\letvalue{\????sf:\v!suffix:\v!serif }\s!Serif
-\letvalue{\????sf:\v!suffix:\v!sans }\s!Sans
-\letvalue{\????sf:\v!suffix:\v!mono }\s!Mono
-\letvalue{\????sf:\v!suffix:\v!handwriting }\s!Handwriting
-\letvalue{\????sf:\v!suffix:\v!calligraphic}\s!Calligraphic
-\letvalue{\????sf:\v!suffix:\v!simplefont }\s!Simplefont
+\letvalue{\????sf:\v!suffix:\v!serif }\s!Serif
+\letvalue{\????sf:\v!suffix:\v!sans }\s!Sans
+\letvalue{\????sf:\v!suffix:\v!mono }\s!Mono
+\letvalue{\????sf:\v!suffix:\v!handwriting}\s!Handwriting
+\letvalue{\????sf:\v!suffix:\v!calligraphy}\s!Calligraphy
+\letvalue{\????sf:\v!suffix:\v!simplefont }\s!Simplefont
-\setvalue{\????sf:\v!math:latinmodernmath}{modern}
+\definetypescriptsynonym[latinmodernmath][latin-modern] % do I need more of them
\def\sf@style #1{\csname\????sf:\v!style :#1\endcsname}
\def\sf@suffix#1{\csname\????sf:\v!suffix:#1\endcsname}
@@ -323,9 +373,13 @@
\stoptexdefinition
-\starttexdefinition simplefonts@bodyfont #1
+\starttexdefinition simplefonts@bodyfont
- \setupbodyfont[#1,\@@@@sfstyle,\@@@@sfsize]
+ \doglobal\increment\simplefonts!typeface
+
+ \simplefonts@family{\v!simplefonts:\simplefonts!typeface}
+
+ \setupbodyfont[\v!simplefonts:\simplefonts!typeface,\@@@@sfstyle,\@@@@sfsize]
\stoptexdefinition
@@ -348,14 +402,6 @@
\stoptexdefinition
-\long\def\startprocessassignmentlist[#1]#2\stopprocessassignmentlist
- {\long\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
- \processassignmentlist[#1]\currentassignmentlistcommand}
-
-\long\def\startprocessassignmentcommand[#1]#2\stopprocessassignmentcommand
- {\long\def\currentassignmentlistcommand##1##2{\def\currentassignmentlistkey{##1}\def\currentassignmentlistvalue{##2}#2}%
- \normalexpanded{\noexpand\processassignmentlist[#1]}\currentassignmentlistcommand}
-
\starttexdefinition simplefonts@features #1#2
\letvalueempty{simplefont!#2features}
@@ -386,7 +432,7 @@
\simplefonts@fontfeature{#1}{##1}
- \ctxlua{thirddata.simplefonts.selectfont("#1","#3","\simplefontparameter\currentcommalistitem","##1","\simplefontparameter\c!weight")}
+ \ctxlua{thirddata.simplefonts.selectfont("#1","#3","\simplefontparameter{##1\s!font}","##1","\simplefontparameter\c!weight")}
\stopprocesscommacommand
@@ -396,14 +442,7 @@
% don't create a typeface and set bodyfont when the module is loaded
- \if!!donesimplefonts
-
- \doglobal\increment\simplefonts!typeface
-
- \simplefonts@family {\v!simplefonts:\simplefonts!typeface}
- \simplefonts@bodyfont{\v!simplefonts:\simplefonts!typeface}
-
- \fi
+ \if!!donesimplefonts\simplefonts@bodyfont\fi
\else
@@ -431,7 +470,7 @@
\simplefonts@fontfeature{#1}{##1}
- \ctxlua{thirddata.simplefonts.selectfont("#1","#3","\simplefontparameter\currentcommalistitem","##1","\simplefontparameter\c!weight")}
+ \ctxlua{thirddata.simplefonts.selectfont("#1","#3","\simplefontparameter{##1\s!font}","##1","\simplefontparameter\c!weight")}
\stopprocesscommacommand
@@ -441,14 +480,7 @@
% don't create a typeface and set bodyfont when the module is loaded
- \if!!donesimplefonts
-
- \doglobal\increment\simplefonts!typeface
-
- \simplefonts@family {\v!simplefonts:\simplefonts!typeface}
- \simplefonts@bodyfont{\v!simplefonts:\simplefonts!typeface}
-
- \fi
+ \if!!donesimplefonts\simplefonts@bodyfont\fi
\else
@@ -474,20 +506,13 @@
% the given name and save it in a macro is is later used to load a predefined
% typescript
- \setvalue{\????sf\currentsimplefont\c!typeface}{\executeifdefined{\????sf:\v!math:\ctxlua{thirddata.simplefonts.normalizefontname("#3")}}{\ctxlua{thirddata.simplefonts.normalizefontname("#3")}}}
+ \setvalue{\????sf\currentsimplefont\c!typeface}{\ctxlua{thirddata.simplefonts.normalizefontname("#3")}}
\ifx\currenttypeface\v!simplefonts
% don't create a typeface and set bodyfont when the module is loaded
- \if!!donesimplefonts
-
- \doglobal\increment\simplefonts!typeface
-
- \simplefonts@family {\v!simplefonts:\simplefonts!typeface}
- \simplefonts@bodyfont{\v!simplefonts:\simplefonts!typeface}
-
- \fi
+ \if!!donesimplefonts\simplefonts@bodyfont\fi
\else
@@ -515,7 +540,7 @@
\simplefonts@fontfeature{#1}{##1}
- \ctxlua{thirddata.simplefonts.selectfont("#1","#3","\simplefontparameter\currentcommalistitem","##1","\simplefontparameter\c!weight")}
+ \ctxlua{thirddata.simplefonts.selectfont("#1","#3","\simplefontparameter{##1\s!font}","##1","\simplefontparameter\c!weight")}
\simplefonts@fontfallback{#2}{#1}{##1}
@@ -548,16 +573,7 @@
\startprocesscommacommand[\simplefonts!commands] % why not \doifinset?
- \ifx\currentcommalistitem\currentmainfont
-
- \doglobal\increment\simplefonts!typeface
-
- \simplefonts@family {\v!simplefonts:\simplefonts!typeface}
- \simplefonts@bodyfont{\v!simplefonts:\simplefonts!typeface}
-
- \quitcommalist
-
- \fi
+ \ifx\currentcommalistitem\currentmainfont\simplefonts@bodyfont\quitcommalist\fi
\stopprocesscommacommand
@@ -575,21 +591,20 @@
{\getparameters[\????sf#1][\c!style=\v!serif,#3]%
\processaction
[\namedsimplefontparameter{#1}\c!style]
- [ \v!serif=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definetextfont [#1][#2]},
- \v!sans=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definetextfont [#1][#2]},
- \v!mono=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definetextfont [#1][#2]},
- \v!math=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definemathfont [#1][#2]},
- \v!math=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definemathfont [#1][#2]},
- \v!handwriting=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definescriptfont[#1][#2]},
- \v!calligraphic=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definescriptfont[#1][#2]},
- \s!unknown=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definetextfont [#1][#2]}]}
-
-\definefontcommand[\v!mainfont ][\v!simplefonts][\c!style=\v!serif ]
-\definefontcommand[\v!sansfont ][\v!simplefonts][\c!style=\v!sans ]
-\definefontcommand[\v!monofont ][\v!simplefonts][\c!style=\v!mono ]
-\definefontcommand[\v!mathfont ][\v!simplefonts][\c!style=\v!math ]
-\definefontcommand[\v!handwritingfont ][\v!simplefonts][\c!style=\v!handwriting ]
-\definefontcommand[\v!calligraphicfont][\v!simplefonts][\c!style=\v!calligraphic]
+ [ \v!serif=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definetextfont [#1][#2]},
+ \v!sans=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definetextfont [#1][#2]},
+ \v!mono=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definetextfont [#1][#2]},
+ \v!math=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definemathfont [#1][#2]},
+ \v!handwriting=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definescriptfont[#1][#2]},
+ \v!calligraphy=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definescriptfont[#1][#2]},
+ \s!unknown=>\setvalue{\e!set#1}{\doquadrupleempty\simplefonts@definetextfont [#1][#2]}]}
+
+\definefontcommand[\v!mainfont ][\v!simplefonts][\c!style=\v!serif ]
+\definefontcommand[\v!sansfont ][\v!simplefonts][\c!style=\v!sans ]
+\definefontcommand[\v!monofont ][\v!simplefonts][\c!style=\v!mono ]
+\definefontcommand[\v!mathfont ][\v!simplefonts][\c!style=\v!math ]
+\definefontcommand[\v!handwritingfont ][\v!simplefonts][\c!style=\v!handwriting]
+\definefontcommand[\v!calligraphicfont][\v!simplefonts][\c!style=\v!calligraphy]
\def\definesubfontcommand
{\dotripleempty\dodefinesubfontcommand}
@@ -615,7 +630,7 @@
\def\dosimplefont[#1][#2]%
{\getparameters[\????sf\v!default][\c!features=\v!default,\c!alternative=\v!regular,\c!weight=\v!normal,#2]%
\ctxlua{thirddata.simplefonts.selectfont("\v!default","#1","","\@@@@sfdefaultalternative","\@@@@sfdefaultweight")}%
- \definedfont[\@@@@sfdefaultregular*\@@@@sfdefaultfeatures]}
+ \definedfont[\csname\????sf\v!default\@@@@sfdefaultalternative\endcsname*\@@@@sfdefaultfeatures]}
\def\definesimplefont
{\dotripleempty\dodefinesimplefont}
@@ -626,21 +641,32 @@
\definefont[#1][\@@@@sfdefaultregular*\@@@@sfdefaultfeatures][#3]}
%D \macros
-%D {simplefontfamily,definesimplefontfamily}
+%D {simplefonttypeface,definesimplefonttypeface,
+%D simplefontfamily,definesimplefontfamily}
-\def\simplefontfamily
- {\dodoubleempty\dosimplefontfamily}
+\def\simplefonttypeface
+ {\dodoubleempty\dosimplefonttypeface}
-\def\dosimplefontfamily[#1][#2]%
+\def\dosimplefonttypeface[#1][#2]%
{\doglobal\increment\simplefonts!fontfamily
- \simplefonts@definetextfont[\v!fontfamily][\v!fontfamily:\simplefonts!fontfamily][#1][\c!style=\v!simplefont,#2]%
+ \doquadrupleargument\simplefonts@definetextfont[\v!fontfamily][\v!fontfamily:\simplefonts!fontfamily][#1][\c!style=\v!simplefont,#2]%
\switchtobodyfont[\v!fontfamily:\simplefonts!fontfamily]}
-\def\definesimplefontfamily
- {\dotripleempty\dodefinesimplefontfamily}
+\def\definesimplefonttypeface
+ {\dotripleempty\dodefinesimplefonttypeface}
-\def\dodefinesimplefontfamily[#1][#2][#3]%
- {\simplefonts@definetextfont[#1][#1][#2][\c!style=\v!serif,#3]}
+\def\dodefinesimplefonttypeface[#1][#2][#3]%
+ {\getparameters[\????sf#1][\c!style=\v!serif,#3]%
+ \processaction
+ [\namedsimplefontparameter{#1}\c!style]
+ [ \v!serif=>{\doquadrupleargument\simplefonts@definetextfont [#1][#1][#2][#3]},
+ \v!sans=>{\doquadrupleargument\simplefonts@definetextfont [#1][#1][#2][#3]},
+ \v!mono=>{\doquadrupleargument\simplefonts@definetextfont [#1][#1][#2][#3]},
+ \v!math=>{\doquadrupleargument\simplefonts@definemathfont [#1][#1][#2][#3]},
+ \v!math=>{\doquadrupleargument\simplefonts@definemathfont [#1][#1][#2][#3]},
+ \v!handwriting=>{\doquadrupleargument\simplefonts@definescriptfont[#1][#1][#2][#3]},
+ \v!calligraphy=>{\doquadrupleargument\simplefonts@definescriptfont[#1][#1][#2][#3]},
+ \s!unknown=>{\doquadrupleargument\simplefonts@definetextfont [#1][#1][#2][#3]}]}
%D Font extensions