%D \module %D [ file=s-fonts-ligatures, %D version=2014.12.14, %D title=\CONTEXT\ Style File, %D subtitle=Show Fonts Ligatures, %D author=Hans Hagen, %D date=\currentdate, %D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}] %C %C This module is part of the \CONTEXT\ macro||package and is %C therefore copyrighted by \PRAGMA. See mreadme.pdf for %C details. % begin info % % title : show some ligature building in fonts % % comment : we trace some ligatures that have rather different implementations in fontss % status : experimental, used for luatex testing % % end info \definefontfeature [otfligaturetest] [analyze=off, ccmp=yes, % brill uses that .. not really ligatures ! %clig=yes, script=latn, language=dflt] \hyphenation{xf-fi-a} \hyphenation{xff-i-b} \hyphenation{xffi-c} \hyphenation{xffid} \registerhyphenationexception[xf-fi-a] \registerhyphenationexception[xff-i-b] \registerhyphenationexception[xffi-c] \registerhyphenationexception[xffid] \starttexdefinition showotfligaturescaption #1 \bTD [align={flushleft,lohi},nx=3] \nohyphens \ttbf #1 \eTD \stoptexdefinition \starttexdefinition showotfligatureslegend #1 \bTD [width=6em,align={flushleft,lohi}] \nohyphens \ttxx original \eTD \bTD [width=6em,align={flushleft,lohi}] \nohyphens \ttxx expanded \eTD \bTD [width=6em,align={flushleft,lohi}] \nohyphens \ttxx traditional \eTD \stoptexdefinition \starttexdefinition showotfligaturesline #1#2 \bTD[toffset=.5ex,frame=off] \starthyphenation[#1] \LigatureFont \showfontkerns \showdiscretionaries \begstrut#2\endstrut \par \stophyphenation \eTD \stoptexdefinition \def\showotfligaturescells{3} %def\showotfligaturesnx {12} %def\showotfligatureswidth{18em} \def\showotfligaturesnx {\the\numexpr 4*\showotfligaturescells} \def\showotfligatureswidth{\the\dimexpr6em*\showotfligaturescells} \starttexdefinition showotfligaturesbanner #1 \bTR[frame=off] \bTD [nx=\showotfligaturesnx,xwidth=\showotfligatureswidth,align={middle,lohi},height=4ex] \tttf #1 \eTD \eTR \stoptexdefinition \starttexdefinition showotfligaturescaptions #1 \bTR[height=3ex,align={middle,lohi},bottomframe=off] \processcommalist[#1]\showotfligaturescaption \eTR \bTR[height=3ex,align={middle,lohi},topframe=off] \processcommalist[#1]\showotfligatureslegend \eTR \stoptexdefinition \starttexdefinition showotfligatureslineset #1 \showotfligaturesline{original} {#1} \showotfligaturesline{expanded} {#1} \showotfligaturesline{traditional}{#1} \stoptexdefinition \starttexdefinition showotfligaturesparagraphset #1 \showotfligatureslineset { \hsize \zeropoint \lefthyphenmin \plustwo \righthyphenmin\plustwo #1 } \stoptexdefinition \starttexdefinition showotfligaturesextremeset #1 \showotfligatureslineset { \hsize \zeropoint \lefthyphenmin \plusone \righthyphenmin\plusone #1 } \stoptexdefinition \starttexdefinition showotfligatureslines #1 \bTR[height=4ex,bottomframe=off] \processcommalist[#1]\showotfligatureslineset \eTR \stoptexdefinition \starttexdefinition showotfligaturesparagraphs #1 \bTR[topframe=off] \processcommalist[#1]\showotfligaturesparagraphset \eTR \stoptexdefinition \starttexdefinition showotfligaturesextremes #1 \bTR[topframe=off] \processcommalist[#1]\showotfligaturesextremeset \eTR \stoptexdefinition \starttexdefinition showotfligaturesdefaults \bTR \bTD [nx=\showotfligaturesnx,xwidth=\showotfligatureswidth,align=middle,height=4ex,frame=off] \start \LigatureFont fb \stop \quad \start \LigatureFont ff \stop \quad \start \LigatureFont fi \stop \quad \start \LigatureFont fk \stop \quad \start \LigatureFont fl \stop \quad \start \LigatureFont ft \stop \quad \start \LigatureFont ffb \stop \quad \start \LigatureFont fff \stop \quad \start \LigatureFont ffi \stop \quad \start \LigatureFont ffl \stop \quad \start \LigatureFont ffk \stop \quad \start \LigatureFont fft \stop \eTD \eTR \stoptexdefinition \starttexdefinition showotfligaturesexample #1#2 % \ctxlua{document.currentdiscexpansion = fonts.getdiscexpansion()}% \showotfligaturescaptions {#1} \showotfligatureslines {#2} \showotfligaturesparagraphs{#2} \showotfligaturesextremes {#2} % \ctxlua{fonts.setdiscexpansion(document.currentdiscexpansion)}% \stoptexdefinition % todo: n -> and split in lua \starttexdefinition showotfligaturesexamples \showotfligaturesexample {leafing,baffling,efficient,shifffahrt} {leafing,baffling,efficient,shifffahrt} \showotfligaturesexample {offbeat,effect,ef-fective,ef\-fective} {offbeat,effect,ef-fective,ef\-fective} \showotfligaturesexample {xf+fi+a,xff+i+b,xffi+c,xffid} {xffia, xffib, xffic, xffid} \stoptexdefinition \starttexdefinition showotfligatures [#1] \begingroup \getdummyparameters[font=Regular,features=default,#1] \definefont[LigatureFont][\dummyparameter{font}*\dummyparameter{features},otfligaturetest ht 2ex] \bTABLE[leftframe=off,rightframe=off] \showotfligaturesbanner{\dummyparameter{font} * \dummyparameter{features}} \showotfligaturesdefaults \showotfligaturesexamples \eTABLE \endgroup \stoptexdefinition \continueifinputfile{s-fonts-ligatures.mkiv} \starttext \definefontfeature[fonttest][default] [mode=node,language=dflt,script=latn,ccmp=yes,liga=yes,kern=yes,mark=yes,mkmk=yes] \definefontfeature[capstest][smallcaps][mode=node,language=dflt,script=latn,ccmp=yes,liga=yes,kern=yes,mark=yes,mkmk=yes] \startTEXpage[offset=10pt] \showotfligatures[font=lmroman10-regular.otf, features=fonttest] \stopTEXpage \startTEXpage[offset=10pt] \showotfligatures[font=dejavu-serif.ttf, features=fonttest] \stopTEXpage \startTEXpage[offset=10pt] \showotfligatures[font=minionpro.otf, features=fonttest] \stopTEXpage \startTEXpage[offset=10pt] \showotfligatures[font=minionpro.otf, features=capstest] \stopTEXpage \startTEXpage[offset=10pt] \showotfligatures[font=brill.otf, features=fonttest] \stopTEXpage \startTEXpage[offset=10pt] \showotfligatures[font=gentiumplus-r.ttf, features=fonttest] \stopTEXpage \startTEXpage[offset=10pt] \showotfligatures[font=cambria, features=fonttest] \stopTEXpage \startTEXpage[offset=10pt] \showotfligatures[font=ebgaramond12-regular.otf,features=fonttest] \stopTEXpage \stoptext