Changes

Jump to navigation Jump to search
1,980 bytes added ,  08:20, 20 November 2019
cleanup
== [[Help:Reference|Syntax]] ==
 <table cellspacing="4" cellpadding="2" class="cmd"syntax> definefontfamily<tr/syntax> <td colspan=="2" classDescription ="cmd">\definefontfamily<span class="first">[...]</span><span  # typescript identifier# font class# existing font name ="second">[...]</span><span class="third">[...]</span><span classExample ="fourth">[...,...In the first example we create a new typeface with the name `mainface` which includes fonts from the TeX Gyre family.Even though there is no math used in this example it is better to set one because math symbols are sometimes used in text mode..,...]</span></td> </tr> <tr valigncontext mode="topmkiv" classsource="firstyes"> <td classtext="cmdproduces">\definefontfamily [mainface] [...rm] [TeX Gyre Pagella]</td> <td>TEXT (typescript identifier)</td>\definefontfamily [mainface] [ss] [TeX Gyre Heros] </tr>\definefontfamily [mainface] [mm] [TeX Gyre Pagella Math] <tr valign="top" class="second"> <td class="cmd">\setupbodyfont[...mainface]</td> <td>\starttext\rm Serif: TeX Gyre Pagella \ss tt mm hw cg serif sans mono math handwriting calligraphySans: TeX Gyre Heros\stoptext</tdcontext> </tr> In this example we are switching the fonts which are used for the upright, italic etc. alternatives. With the help of the `style` keyword you access one of the predefined styles, by default `\definefontfamily` uses the following styles for each alternative: {|! Alternative !! Style|-| tf || regular|-| it || italic|-| sl || slanted|-| bf || bold|-|bi || bolditalic|-| sc || smallcaps|} <tr valigncontext mode="topmkiv" classsource="thirdyes"> <td classtext="cmdproduces">\definefontfamily[changedstyles][rm][TeX Gyre Pagella][tf=style:italic,it=style:bold,bf=style:bolditalic,bi=style:regular] \setupbodyfont[pagella] \starttext\rm\tf Regular, \it Italic, \bf Bold and \bi BoldItalic\switchtobodyfont[changedstyles] \rm\tf Regular, \it Italic, \bf Bold and \bi BoldItalic..]</td> <td>TEXT (existing font name)</tdcontext> </tr> <tr valigncontext mode="topmkiv" classsource="fourthyes"> <td classtext="cmdproduces">\definefontfamily[changedfiles][Command/keyword:scale|scalerm][TeX Gyre Pagella]</td> <td>[[Command/valueit=file:texgyreherositalic,bi=file:NUMBER|NUMBERtexgyrecursorbolditalic\setupbodyfont[changedfiles\starttext\tf Regular, \it Italic, \bf Bold and \bi BoldItalic.</tdcontext> </tr> <tr valigncontext mode="topmkiv" classsource="fourthyes"> <td classtext="cmdproduces">\definefontfamily[changedfeatures][Command/keyword:alternative|alternativerm][TeX Gyre Pagella]</td> <td>[[Command/valuetf=features:smallcaps,bf=features:default|default]none]  \setupbodyfont[[Command/value:selectfont|selectfontpagella]] [ \starttext\tf ffi, \it ffi, \bf ffi, \bi ffi. \switchtobodyfont[Command/value:simplefonts|simplefonts]changedfeatures\tf ffi, \it ffi, \bf ffi, \bi ffi.\stoptext</tdcontext> </tr> 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. <tr valigncontext mode="topmkiv" classsource="fourthyes"> <td classtext="cmdproduces">\definefontfamily [mainface][Command/keyword:features|featuresserif][Latin Modern Roman]</td> <td> [[Command/valuetf=file:IDENTIFIER|IDENTIFIER]]</td>filename_serif_regular.ttf, </tr> it=file:filename_serif_italic.ttf, <tr valign bf="top" classfile:filename_serif_bold.ttf, bi="fourth">file:filename_serif_bold_italic.ttf, <td class sc="cmd">file:filename_serif_smallcaps.ttf]\definefontfamily [mainface][Command/keyword:opticalsize|opticalsizesans][Latin Modern Sans]</td> <td> [[Command/valuetf=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:yes|yesfilename_sans_smallcaps.ttf]\definefontfamily [mainface] [mono] [Command/value:no|noLatin Modern Mono][features=none]</td>\definefontfamily [mainface] [math] [Latin Modern Math]\setupbodyfont [mainface,11pt] \starttext\tf ffi, \it ffi, \bf ffi, \bi ffi. \tt Monospaced $\sqrt{3x^2}$ \stoptext </trcontext> <tr valign== See also ="top" class="fourth"> <td class="* {{cmd|setupfonts}}* {{cmd|definefont}}* {{cmd|definetypeface}}* {{cmd|definefontsynonym}}* {{cmd|definefontfile}}* {{cmd">[[Command/keyword:goodies|goodies]]</td>definefallbackfamily}}  <td>[[Category:Command/value:IDENTIFIERFonts|IDENTIFIERdefinefontfamily]]</td> </tr></table>

Navigation menu