Difference between revisions of "Fonts"

From Wiki
Jump to navigation Jump to search
Line 8: Line 8:
  
 
<context mode="mkiv">
 
<context mode="mkiv">
\definepapersize[sheet][width=15cm,height=11cm]
 
\setuppapersize[sheet]
 
\setuplayout[topspace=0.5mm, backspace=0.5mm,header=0pt, headerdistance=0pt,footer=0pt,footerdistance=0pt,width=14cm,height=11cm]
 
\setupbodyfont[14pt]
 
 
\definefontfamily [mainfacea] [rm] [latinmodernroman]
 
\definefontfamily [mainfacea] [rm] [latinmodernroman]
 
\definefontfamily [mainfaceb] [rm] [latinmodernsans]
 
\definefontfamily [mainfaceb] [rm] [latinmodernsans]
Line 26: Line 22:
 
\definefontfamily [mainfacem] [rm] [dejavusansmono]
 
\definefontfamily [mainfacem] [rm] [dejavusansmono]
 
\definefontfamily [mainfacen] [rm] [gentium]
 
\definefontfamily [mainfacen] [rm] [gentium]
 +
 +
\definepapersize[sheet][width=15cm,height=11cm]  \setuppapersize[sheet]
 +
\setuplayout[topspace=0.5mm, backspace=0.5mm,header=0pt, headerdistance=0pt,footer=0pt,footerdistance=0pt,width=14cm,height=11cm]
 
\setupbodyfont[mainfacea]
 
\setupbodyfont[mainfacea]
 +
\switchtobodyfont[12pt]
  
 
\starttext
 
\starttext
\startitemize[n,packed]
+
\switchtobodyfont[mainfacea] The quick brown fox jumps over the lazy dog\\
\item \switchtobodyfont[mainfacea] The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfaceb] The quick brown fox jumps over the lazy dog\\
\item \switchtobodyfont[mainfaceb] The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfacec] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfacec] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfaced] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfaced] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfacee] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfacee] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfacef] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfacef] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfaceg] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfaceg] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfaceh] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfaceh] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfacei] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfacei] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfacej] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfacej] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfacek] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfacek] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfacel] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfacel] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfacem] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfacem] \item The quick brown fox jumps over the lazy dog\\
+
\switchtobodyfont[mainfacen] The quick brown fox jumps over the lazy dog\\
\switchtobodyfont[mainfacen] \item The quick brown fox jumps over the lazy dog\\
+
 
\stopitemize
 
 
\stoptext
 
\stoptext
 
</context>
 
</context>
Line 51: Line 50:
 
\definepapersize[sheet][width=4.1cm,height=2cm]  \setuppapersize[sheet]
 
\definepapersize[sheet][width=4.1cm,height=2cm]  \setuppapersize[sheet]
 
\setuplayout[topspace=0.5mm, backspace=0.5mm,header=0pt, headerdistance=0pt,footer=0pt,footerdistance=0pt,width=4cm,heigth=2cm]
 
\setuplayout[topspace=0.5mm, backspace=0.5mm,header=0pt, headerdistance=0pt,footer=0pt,footerdistance=0pt,width=4cm,heigth=2cm]
\definefontfamily [mainface] [rm] [texgyreadventor]
+
\definefontfamily [mainfacem] [rm] [dejavusansmono]
\definefontfamily [mainfacf] [rm] [gentium]
+
\definefontfamily [mainfacen] [rm] [gentium]
\setupbodyfont[mainface]
+
\setupbodyfont[mainfacem]
 
\switchtobodyfont[12pt]
 
\switchtobodyfont[12pt]
\starttext \rm Tex Gyre Adventor\\
+
\starttext
\switchtobodyfont[mainfacf]
+
\rm
Tex Gyre Adventor
+
dejavusansmono\\
\stoptext
+
\switchtobodyfont[mainfacen]
 +
gentium
 +
\stoptext
 
</context>
 
</context>

Revision as of 18:22, 31 May 2020

First, be aware of the 21 fonts provided by the ConTeXt distribution's Fonts.

If required, you can regenerate the font database: mtxrun --script font --reload --force

How to use the fonts included by default in the distribution