Open main menu

Changes

adding compiled documents
Here is the most basic sample:
<texcodecontext mode="mkiv" source="yes">
\setupbodyfontenvironment[default][em=italic]
\usemodule[simplefonts][size=10pt]
\setmainfont[FreeSerif]\setmonofont[FreeMonoTeX Gyre Termes]\setsansfont[FreeSans] \starttextSerif typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts. {\ss Sans--serif typeface: regular {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.} {\tt Monospace typeface: regular {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.}\stoptext</texcode> It isn’t required to define size for 12pt, since it is the default value. <!-- when MkIV is enabled in the wikiThis is the output: <context>\setupbodyfontenvironment[default][em=italic]\usemodule[simplefonts][size=10pt]\setmainfont[FreeSerifTeX Gyre Heros]\setmonofont[FreeMono]\setsansfont[FreeSansTeX Gyre Cursor]
\starttext
\stoptext
</context>
-->It isn’t required to define size for 12pt, since it is the default value.
=== Mixing fonts ===
In some cases, you might want to mix fonts (it is up to you whether they really match or not).
Here is the way to do it(I know that fonts don’t match):
<texcodecontext mode="mkiv" source="yes">
\setupbodyfontenvironment[default][em=italic]
\usemodule[simplefonts]
\setmainfont[TheanoDidotTeX Gyre Termes][italicfont=Old StandardTeX Gyre Bonum-Italic, boldfont=Old StandardTeX Gyre Adventor-Bold,bolditalicfont=TeX Gyre Pagella-Bold Italic] % yes, bold italics don’t match
\starttext
Serif typeface: regular , {\em italic}, {\bf bold} and {\bf\em bold italic} fonts.
\stoptext
</texcodecontext>
=== Font fallback mechanism ===
The example shows how to get Greek characters for TeX Gyre Pagella:
<texcodecontext mode="mkiv" source="yes">
\setupbodyfontenvironment[default][em=italic]
\usemodule[simplefonts]
{\bf\em English text. δύσκολα τὰ καλά.}
\stoptext
</texcodecontext>
Two things to be considered:
Again, it would be the exception, rather than the rule, where this suggested method outputs a reasonable result. If you use ConTeXt for its high–quality typographical performance, using faked fonts can ruin that performance.
Wolfgang Schuster proposed the following code to get slanted and fake bold fonts (not working right now, I guess it’s a bug):
<texcodecontext mode="mkiv" source="yes">
\setupbodyfontenvironment[default][em=italic]
\usemodule[simplefonts]
\definefontfeature[fakebold][default][extend=2]
\definefontfeature[fakebolditalic][default][slant=.25, extend=2]
\setmainfont[LarabiefontTeX Gyre Pagella] \definesimplefonttypeface[fakingall][TeX Gyre Pagella][italicfont={* Regular}, boldfont={*Regular}, bolditalicfont={* Regular}, italicfeatures=fakeitalic,
boldfeatures=fakebold, bolditalicfeatures=fakebolditalic]
 \starttextCompare: Four fonts, real typeface: regular, {\em italic}, {\bf bold} and {\bf\em bold italic} fonts. {\fakingall One font, faked typeface: regular, {\em italic (actually slanted)} (actually slanted), {\bf bold (actually stretched)} and {\bf\em bold and slanted (actually slanted and stretched)} fonts.}\stoptext</texcodecontext>
139

edits