summaryrefslogtreecommitdiff
path: root/tex/context/base/font-pre.mkiv
diff options
context:
space:
mode:
authorMarius <mariausol@gmail.com>2012-01-10 13:33:35 +0200
committerMarius <mariausol@gmail.com>2012-01-10 13:33:35 +0200
commitd44c3d2b9ac2a797c610b9b472527119c08bf206 (patch)
tree09dca91a6255797b040b88c2ea348e162c0842e4 /tex/context/base/font-pre.mkiv
parent2ee95c7070f4d16d25209332378cb27e599292f7 (diff)
downloadcontext-d44c3d2b9ac2a797c610b9b472527119c08bf206.tar.gz
beta 2012.01.09 10:08
Diffstat (limited to 'tex/context/base/font-pre.mkiv')
-rw-r--r--tex/context/base/font-pre.mkiv466
1 files changed, 466 insertions, 0 deletions
diff --git a/tex/context/base/font-pre.mkiv b/tex/context/base/font-pre.mkiv
new file mode 100644
index 000000000..a7769dffb
--- /dev/null
+++ b/tex/context/base/font-pre.mkiv
@@ -0,0 +1,466 @@
+%D \module
+%D [ file=font-pre,
+%D version=2012.01.04, % moved from font-ini
+%D title=\CONTEXT\ Font Macros,
+%D subtitle=Predefined,
+%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.
+
+\writestatus{loading}{ConTeXt Font Macros / Predefined}
+
+\unprotect
+
+%D A basic set of features is defined here.
+
+\definefontfeature
+ [always]
+ [mode=auto,
+ script=auto,
+ kern=yes,
+ mark=yes,
+ mkmk=yes,
+ curs=yes]
+
+\definefontfeature
+ [default]
+ [always]
+ [liga=yes,
+ tlig=yes,
+ trep=yes] % texligatures=yes,texquotes=yes
+
+\definefontfeature
+ [smallcaps]
+ [always]
+ [smcp=yes,
+ tlig=yes,
+ trep=yes] % texligatures=yes,texquotes=yes
+
+\definefontfeature
+ [oldstyle]
+ [always]
+ [onum=yes,
+ liga=yes,
+ tlig=yes,
+ trep=yes] % texligatures=yes,texquotes=yes
+
+\definefontfeature % == default unless redefined
+ [ligatures]
+ [always]
+ [liga=yes,
+ tlig=yes,
+ trep=yes]
+
+\definefontfeature % can be used for type1 fonts
+ [complete]
+ [always]
+ [compose=yes,
+ liga=yes,
+ tlig=yes,
+ trep=yes]
+
+\definefontfeature
+ [none]
+ [mode=none,
+ features=no]
+
+\definefontfeature % might move
+ [arabic]
+ [mode=node,language=dflt,script=arab,ccmp=yes,
+ init=yes,medi=yes,fina=yes,isol=yes,
+ liga=yes,dlig=yes,rlig=yes,clig=yes,calt=yes,
+ mark=yes,mkmk=yes,kern=yes,curs=yes]
+
+\definefontfeature % might move
+ [simplearabic]
+ [mode=node,language=dflt,script=arab,
+ init=yes,medi=yes,fina=yes,calt=yes,
+ rlig=yes,curs=yes,mark=yes,mkmk=yes]
+
+% symbols:
+
+\definefontfeature
+ [dingbats]
+ [mode=base,
+ goodies=dingbats,
+ unicoding=yes]
+
+% math:
+
+\definefontfeature
+ [mathematics]
+ [mode=base,
+ liga=yes,
+ kern=yes,
+ tlig=yes,
+ trep=yes,
+ mathalternates=yes,
+ mathitalics=yes,
+ % nomathitalics=yes, % don't pass to tex, might become default
+ language=dflt,
+ script=math]
+
+\definefontfeature
+ [mathematics-l2r]
+ [mathematics]
+ []
+
+\definefontfeature
+ [mathematics-r2l]
+ [mathematics]
+ [language=ara,
+ rtlm=yes,
+ locl=yes]
+
+\definefontfeature[virtualmath] [mathematics] % downward compatibility
+\definefontfeature[virtualmath-l2r] [mathematics-l2r] % downward compatibility
+\definefontfeature[virtualmath-r2l] [mathematics-r2l] % downward compatibility
+
+\definefontfeature[math-text] [mathematics] [ssty=no]
+\definefontfeature[math-script] [mathematics] [ssty=1,mathsize=yes]
+\definefontfeature[math-scriptscript] [mathematics] [ssty=2,mathsize=yes]
+
+\definefontfeature[math-text-l2r] [mathematics-l2r] [ssty=no]
+\definefontfeature[math-script-l2r] [mathematics-l2r] [ssty=1,mathsize=yes]
+\definefontfeature[math-scriptscript-l2r] [mathematics-l2r] [ssty=2,mathsize=yes]
+
+\definefontfeature[math-text-r2l] [mathematics-r2l] [ssty=no]
+\definefontfeature[math-script-r2l] [mathematics-r2l] [ssty=1,mathsize=yes]
+\definefontfeature[math-scriptscript-r2l] [mathematics-r2l] [ssty=2,mathsize=yes]
+
+\definefontfeature[math-nostack-text] [math-text] [nostackmath=yes]
+\definefontfeature[math-nostack-script] [math-script] [nostackmath=yes]
+\definefontfeature[math-nostack-scriptscript][math-scriptscript][nostackmath=yes]
+
+% \definefontfeature[mathtext] [math-text]
+% \definefontfeature[mathscript] [math-script]
+% \definefontfeature[mathscriptscript] [math-scriptscript]
+
+%D We define some colors that are used in tracing (for instance \OPENTYPE\
+%D features). We cannot yet inherit because no colors are predefined.
+
+\definecolor[trace:0][s=.6]
+\definecolor[trace:1][r=.6]
+\definecolor[trace:2][g=.6]
+\definecolor[trace:3][b=.6]
+\definecolor[trace:4][r=.6,g=.6]
+\definecolor[trace:5][r=.6,b=.6]
+\definecolor[trace:6][g=.6,b=.6]
+\definecolor[trace:7][r=.8,g=.4]
+\definecolor[trace:8][r=.8,b=.4]
+\definecolor[trace:9][g=.4,b=.8]
+
+\definecolor[font:init][r=.75]
+\definecolor[font:medi][g=.75]
+\definecolor[font:fina][b=.75]
+\definecolor[font:isol][r=.75,g=.75] % [y=.75]
+\definecolor[font:mark][r=.75,b=.75] % [m=.75]
+\definecolor[font:rest][g=.75,b=.75] % [c=.75]
+
+%D Now we're up to some definitions.
+
+\definebodyfontenvironment
+ [\s!default]
+ [ \s!text=1.0,
+ \s!script=0.7,
+ \s!scriptscript=0.5,
+ \s!a=1.200,
+ \s!b=1.440,
+ \s!c=1.728,
+ \s!d=2.074,
+ *=\currentfontscale, % wildcard
+ \s!x=0.8,
+ \s!xx=0.6,
+ \v!big=1.2,
+ \v!small=0.8,
+ \c!interlinespace=,
+ \s!em=\v!slanted]
+
+\definebodyfontenvironment
+ [20.7pt]
+ [ \s!text=20.7pt,
+ \s!script=\!!fourteenpointfour,
+ \s!scriptscript=\!!twelvepoint,
+ \s!x=17.3pt,
+ \s!xx=\!!fourteenpointfour,
+ \v!big=20.7pt, % !!!!
+ \v!small=17.3pt]
+
+\definebodyfontenvironment
+ [17.3pt]
+ [ \s!text=17.3pt,
+ \s!script=\!!twelvepoint,
+ \s!scriptscript=\!!tenpoint,
+ \s!x=\!!fourteenpointfour,
+ \s!xx=\!!twelvepoint,
+ \v!big=20.7pt,
+ \v!small=\!!fourteenpointfour]
+
+\definebodyfontenvironment
+ [\!!fourteenpointfour]
+ [ \s!text=\!!fourteenpointfour,
+ \s!script=\!!elevenpoint,
+ \s!scriptscript=\!!ninepoint,
+ \s!x=\!!twelvepoint,
+ \s!xx=\!!tenpoint,
+ \v!big=17.3pt,
+ \v!small=\!!twelvepoint]
+
+\definebodyfontenvironment
+ [\!!twelvepoint]
+ [ \s!text=\!!twelvepoint,
+ \s!script=\!!ninepoint,
+ \s!scriptscript=\!!sevenpoint,
+ \s!x=\!!tenpoint,
+ \s!xx=\!!eightpoint,
+ \v!big=\!!fourteenpointfour,
+ \v!small=\!!tenpoint]
+
+\definebodyfontenvironment
+ [\!!elevenpoint]
+ [ \s!text=\!!elevenpoint,
+ \s!script=\!!eightpoint,
+ \s!scriptscript=\!!sixpoint,
+ \s!x=\!!ninepoint,
+ \s!xx=\!!sevenpoint,
+ \v!big=\!!twelvepoint,
+ \v!small=\!!ninepoint]
+
+\definebodyfontenvironment
+ [\!!tenpoint]
+ [ \s!text=\!!tenpoint,
+ \s!script=\!!sevenpoint,
+ \s!scriptscript=\!!fivepoint,
+ \s!x=\!!eightpoint,
+ \s!xx=\!!sixpoint,
+ \v!big=\!!twelvepoint,
+ \v!small=\!!eightpoint]
+
+\definebodyfontenvironment
+ [\!!ninepoint]
+ [ \s!text=\!!ninepoint,
+ \s!script=\!!sevenpoint,
+ \s!scriptscript=\!!fivepoint,
+ \s!x=\!!sevenpoint,
+ \s!xx=\!!fivepoint,
+ \v!big=\!!elevenpoint,
+ \v!small=\!!sevenpoint]
+
+\definebodyfontenvironment
+ [\!!eightpoint]
+ [ \s!text=\!!eightpoint,
+ \s!script=\!!sixpoint,
+ \s!scriptscript=\!!fivepoint,
+ \s!x=\!!sixpoint,
+ \s!xx=\!!fivepoint,
+ \v!big=\!!tenpoint,
+ \v!small=\!!sixpoint]
+
+\definebodyfontenvironment
+ [\!!sevenpoint]
+ [ \s!text=\!!sevenpoint,
+ \s!script=\!!sixpoint,
+ \s!scriptscript=\!!fivepoint,
+ \s!x=\!!sixpoint,
+ \s!xx=\!!fivepoint,
+ \v!big=\!!ninepoint,
+ \v!small=\!!fivepoint]
+
+\definebodyfontenvironment
+ [\!!sixpoint]
+ [ \s!text=\!!sixpoint,
+ \s!script=\!!fivepoint,
+ \s!scriptscript=\!!fivepoint,
+ \s!x=\!!fivepoint,
+ \s!xx=\!!fivepoint,
+ \v!big=\!!eightpoint,
+ \v!small=\!!fivepoint]
+
+\definebodyfontenvironment
+ [\!!fivepoint]
+ [ \s!text=\!!fivepoint,
+ \s!script=\!!fivepoint,
+ \s!scriptscript=\!!fivepoint,
+ \s!x=\!!fivepoint,
+ \s!xx=\!!fivepoint,
+ \v!big=\!!sevenpoint,
+ \v!small=\!!fivepoint]
+
+\definebodyfontenvironment
+ [\!!fourpoint]
+ [ \s!text=\!!fourpoint,
+ \s!script=\!!fourpoint,
+ \s!scriptscript=\!!fourpoint,
+ \s!x=\!!fourpoint,
+ \s!xx=\!!fourpoint,
+ \v!big=\!!sixpoint,
+ \v!small=\!!fourpoint]
+
+\definebodyfontswitch [fourteenpointfour] [\!!fourteenpointfour]
+\definebodyfontswitch [twelvepoint] [\!!twelvepoint]
+\definebodyfontswitch [elevenpoint] [\!!elevenpoint]
+\definebodyfontswitch [tenpoint] [\!!tenpoint]
+\definebodyfontswitch [ninepoint] [\!!ninepoint]
+\definebodyfontswitch [eightpoint] [\!!eightpoint]
+\definebodyfontswitch [sevenpoint] [\!!sevenpoint]
+\definebodyfontswitch [sixpoint] [\!!sixpoint]
+\definebodyfontswitch [fivepoint] [\!!fivepoint]
+\definebodyfontswitch [fourpoint] [\!!fourpoint]
+
+%D So far.
+
+\definefontstyle [\s!mm] [\s!mm]
+\definefontstyle [\s!rm,\v!roman,\v!serif,\v!regular] [\s!rm]
+\definefontstyle [\s!ss,\v!sansserif,\v!sans,\v!support] [\s!ss]
+\definefontstyle [\s!tt,\v!teletype,\v!type,\v!mono] [\s!tt]
+\definefontstyle [\s!hw,\v!handwritten] [\s!hw]
+\definefontstyle [\s!cg,\v!calligraphic] [\s!cg]
+
+\definefontalternative[\s!tf]
+\definefontalternative[\s!bf]
+\definefontalternative[\s!it]
+\definefontalternative[\s!sl]
+\definefontalternative[\s!bs]
+\definefontalternative[\s!bi]
+\definefontalternative[\s!sc]
+
+\definefontsize[\s!a] \definefontsize[\s!b]
+\definefontsize[\s!c] \definefontsize[\s!d]
+
+\definealternativestyle [\v!mediaeval] [\os] []
+\definealternativestyle [\v!normal] [\tf] []
+\definealternativestyle [\v!bold] [\bf] []
+\definealternativestyle [\v!type] [\tt] []
+\definealternativestyle [\v!mono] [\tt] []
+\definealternativestyle [\v!slanted] [\sl] []
+\definealternativestyle [\v!italic] [\it] []
+\definealternativestyle [\v!boldslanted,\v!slantedbold] [\bs] []
+\definealternativestyle [\v!bolditalic,\v!italicbold] [\bi] []
+
+\definealternativestyle [\v!small,\v!smallnormal] [\setsmallbodyfont\tf] []
+\definealternativestyle [\v!smallbold] [\setsmallbodyfont\bf] []
+\definealternativestyle [\v!smalltype] [\setsmallbodyfont\tt] []
+\definealternativestyle [\v!smallslanted] [\setsmallbodyfont\sl] []
+\definealternativestyle [\v!smallboldslanted,\v!smallslantedbold] [\setsmallbodyfont\bs] []
+\definealternativestyle [\v!smallbolditalic,\v!smallitalicbold] [\setsmallbodyfont\bi] []
+
+\definealternativestyle [\v!bigger] [\setbigbodyfont \tf] []
+\definealternativestyle [\v!smaller] [\setsmallbodyfont\tf] []
+
+\definealternativestyle [\v!sans,\v!sansserif] [\ss] []
+\definealternativestyle [\v!sansbold] [\ss\bf] []
+
+% % maybe we need interface neutral as well (for use in cld):
+%
+% \letcscsname\mediaeval \csname\v!mediaeval \endcsname
+% \letcscsname\normal \csname\v!normal \endcsname
+% \letcscsname\bold \csname\v!bold \endcsname
+% \letcscsname\mono \csname\v!mono \endcsname
+% \letcscsname\slanted \csname\v!slanted \endcsname
+% \letcscsname\italic \csname\v!italic \endcsname
+% \letcscsname\boldslanted \csname\v!boldslanted \endcsname
+% \letcscsname\slantedbold \csname\v!slantedbold \endcsname
+% \letcscsname\bolditalic \csname\v!bolditalic \endcsname
+% \letcscsname\italicbold \csname\v!italicbold \endcsname
+%
+% \letcscsname\small \csname\v!small \endcsname
+% \letcscsname\smallnormal \csname\v!smallnormal \endcsname
+% \letcscsname\smallbold \csname\v!smallbold \endcsname
+% \letcscsname\smalltype \csname\v!smalltype \endcsname
+% \letcscsname\smallslanted \csname\v!smallslanted \endcsname
+% \letcscsname\smallboldslanted\csname\v!smallboldslanted\endcsname
+% \letcscsname\smallslantedbold\csname\v!smallslantedbold\endcsname
+% \letcscsname\smallbolditalic \csname\v!smallbolditalic \endcsname
+% \letcscsname\smallitalicbold \csname\v!smallitalicbold \endcsname
+%
+% \letcscsname\bigger \csname\v!bigger \endcsname
+% \letcscsname\smaller \csname\v!smaller \endcsname
+%
+% \letcscsname\sans \csname\v!sans \endcsname
+% \letcscsname\sansserif \csname\v!sansserif \endcsname
+% \letcscsname\sansbold \csname\v!sansbold \endcsname
+
+%D We can go on and on and on:
+%D
+%D \starttyping
+%D \setupbodyfontenvironment[default][p=0.8,q=0.6]
+%D \definefontsize[p]
+%D \definefontsize[q]
+%D \stoptyping
+
+%D Slow but handy:
+
+\definealternativestyle [\v!smallbodyfont] [\setsmallbodyfont] []
+\definealternativestyle [\v!bigbodyfont] [\setbigbodyfont] []
+
+%D We treat {\sc Small Caps} and \cap {Pseudo Caps} a bit
+%D different. We also provide an \WORD {uppercase} style.
+
+\definealternativestyle [\v!cap,\v!capital] [\smallcapped] [\smallcapped]
+\definealternativestyle [\v!smallcaps] [\sc] [\sc]
+\definealternativestyle [\v!WORD] [\WORD] [\WORD]
+
+%D \macros
+%D {tinyfont}
+%D
+%D By default we load the Computer Modern Roman fonts (but
+%D not yet at this moment) and activate the 12pt roman
+%D bodyfont. Sans serif and teletype are also available and
+%D can be called for by \type{\ss} and \type{\tt}. Loading
+%D takes place elsewhere.
+%D
+%D For tracing purposes we define:
+
+\definefont[tinyfont][Mono at 1ex]
+
+%D \macros
+%D {infofont}
+%D
+%D The second situation occurs when we enable the info mode,
+%D and put all kind of status information in the margin. We
+%D don't want huge switches to the main bodyfont and style, so
+%D here too we use a direct method.
+
+\let\infofont\relax % satisfy dep checker
+
+\definefont [infofont] [Mono at 6pt] % todo \the\everybodyfont
+
+\protect \endinput
+
+% LM math vs CM math (analysis by Taco):
+%
+% Computer Modern Roman : Donald Knuth
+% Latin Modern : LM Font Revision Team
+%
+% lmex10.tfm % identical
+% lmmi5.tfm % identical
+% lmmi6.tfm % identical
+% lmmi7.tfm % identical
+% lmmi8.tfm % identical
+% lmmi9.tfm % identical
+% lmmi10.tfm % identical
+% lmmi12.tfm % identical
+% lmmib10.tfm % identical
+% lmsy5.tfm % extra chars: 254,255 (octal)
+% lmsy6.tfm % extra chars: 254,255 (octal)
+% lmsy7.tfm % extra chars: 254,255 (octal)
+% lmsy8.tfm % extra chars: 254,255 (octal)
+% lmsy9.tfm % extra chars: 254,255 (octal)
+% lmsy10.tfm % extra chars: 254,255 (octal)
+% lmbsy10.tfm % extra chars: 254,255 (octal)
+%
+% From the 'AMS' set:
+%
+% lmmib5.tfm % identical
+% lmmib7.tfm % identical
+% lmbsy5.tfm % extra chars: 254,255 (octal)
+% lmbsy7.tfm % extra chars: 254,255 (octal)
+%
+% The two extra characters are:
+%
+% /lessorequalslant
+% /greaterorequalslant