Changes

Jump to navigation Jump to search
no edit summary
|attributes=
}}
 
== [[Help:Reference|Syntax]] (autogenerated) ==
<syntax>definefontfamily</syntax>
 
== [[Help:Reference|Syntax]] ==
<table cellspacing== Description ="4" cellpadding="2"  # typescript identifier# font class# existing font name == Example =="cmd"> <tr> 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. <td colspancontext mode="2mkiv" classsource="cmdyes">\definefontfamily<span classtext="firstproduces">\definefontfamily [mainface] [...rm] [TeX Gyre Pagella]\definefontfamily [mainface] [ss] [TeX Gyre Heros]\definefontfamily [mainface] [mm]</span><span class="second">[...TeX Gyre Pagella Math]</span><span class="third"> \setupbodyfont[...mainface\starttext\rm Serif: TeX Gyre Pagella \ss Sans: TeX Gyre Heros\stoptext</spancontext><span class="fourth">[... 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,...]</span></td>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> <tr valigncontext mode="topmkiv" classsource="firstyes"> <td classtext="cmdproduces">\definefontfamily[changedstyles][...rm][TeX Gyre Pagella]</td> <td>TEXT (typescript identifier)</td> </tr> <tr valign[tf=style:italic,it=style:bold,bf="top" classstyle:bolditalic,bi="second">style:regular]  <td class="cmd">\setupbodyfont[...pagella]</td> <td>\starttext\rm ss tt mm hw cg serif sans mono math handwriting calligraphy</td>\tf Regular, \it Italic, \bf Bold and \bi BoldItalic.  </tr>\switchtobodyfont[changedstyles] <tr valign="top" class="third"> <td class="cmd">[\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