Changes

Jump to navigation Jump to search
m
no edit summary
This page is a draft which I hope will evolve into some kind of beginnerConsider reading: * http://context.aanhet.net/svn/contextman/context-reference/en/co-fonts.pdf - Chapter on fonts* [[A Beginner's guide Guide to understanding what's going on Using Fonts in ConTeXt as far as fonts are concernedMark IV]]. Currently I can hardly understand anything about The idea is that the page says ''how'' to easily use fonts (or rather typescripts) in Mark IV, so that you just take a ready-to-use recipe from there and paste it, but into your document. Most of the following material comes from the answers I keep on asking got on the mailing list;and/or the documentation (mfonts.pdf) . Since crediting people for each and every answer would be cumbersome, I'm going d like to post the answers thank hereall of you that helped me understand ConTeXt (especially Hans, of course). == How to typeset in, say, Palatino == <context source="yes">\usetypescriptfile[type-gyr]\usetypescript[palatino][qx]\setupbodyfont[palatino,10pt] \starttextHello world, I'm Palatino!\stoptext</context> <cmd>usetypescriptfile</cmd> loads a given file ([[source:type-gyr.tex|type-gyr.tex]] in this case). This file usually contains definitions of ''typescripts''. The core typescript files (such as [[source:type-tmf.tex|type-tmf.tex]], [[source:type-one.tex|type-one. tex]] in pdTeX or [[Usersource:Mborktype-otf.tex|Mborktype-otf.tex]] in LuaTeX/XeTeX, ...) are already preloaded, so you would usually need this only to load your own definitions. <code>\usetypescriptfile[type-gyr]</code> will soon become obsolete (TeX Gyre will be the default). <cmd>usetypescript</cmd> kind of "selects" (?) the specified typescript from that file. It takes up to three parametres and their rôles are still cryptic to me... == Defining typescripts ==One of the keys for defining typescripts is clever usage of the <cmd>definefontsynonym</cmd> command. It takes 2 or three parameters. Example from mfonts.pdf:<texcode>\definefontsynonym[Serif][Times-Roman]\definefontsynonym[Times-Roman][tir][encoding=texnansi] 00</texcode> The first case - with two arguments - makes <code>Serif</code> kind of an "alias" (?) for <code>Times-Roman</code>. Both names are completely independent of name of the font file. This is clever, since instead of fiddling with font file names one can say <code>Times-Roman</code> and just don't care where it resides on tbe disk. Or even better:19one can say <code>Serif</code> and don't care whether the final version of the document will use Times, Palatino or Latin Modern. The second one makes <code>Times-Roman</code> an "alias" (?) for font stored in the file called <code>tir</code> (probably with some extension?). The third argument specifies the encoding (it might be qx, for instance, or something else) and possibly another options, 5 March 2008 like <code>features=smallcaps</code> (for opentype fonts). Encoding is used by pdfTeX only - XeTeX and LuaTeX both use Unicode (CETMojca - thanks for this point!). Other possibilities include <code>mapping</code> and <code>handling</code>, but don't ask me about these;).
419

edits

Navigation menu