Changes

Jump to navigation Jump to search
Example how to explicitly reference a font file.
\tf ffi, \it ffi, \bf ffi, \bi ffi.
\stoptext
</context>
 
If it is not possible to install fonts system-wide, one can explicitly specify the filename of a font. Custom fonts often don't come with math symbols or a fitting monospaced font. One can replace these using Latin Modern which comes with ConTeXt.
 
<context mode="mkiv" source="yes" text="produces">
\definefontfamily [mainface][serif] [features=none]
[tf=file:filename_serif_regular.ttf,
it=file:filename_serif_italic.ttf,
bf=file:filename_serif_bold.ttf,
bi=file:filename_serif_bold_italic.ttf,
sc=file:filename_serif_smallcaps.ttf]
\definefontfamily [mainface][sans] [features=none]
[tf=file:filename_sans_regular.ttf,
it=file:filename_sans_italic.ttf,
bf=file:filename_sans_bold.ttf,
bi=file:filename_sans_bold_italic.ttf,
sc=file:filename_sans_smallcaps.ttf]
\definefontfamily [mainface] [mono] [Latin Modern Mono ][default]
\definefontfamily [mainface] [math] [Latin Modern Math][default]
\setupbodyfont [mainface,11pt]
\starttext
\tf ffi, \it ffi, \bf ffi, \bi ffi.
 
\tt Monospaced
 
$\sqrt{3x^2}$
 
\stoptext
 
</context>
1

edit

Navigation menu