Changes

Jump to navigation Jump to search
no edit summary
</texcode>
;3. Check by looking for the specific font you want to use next. A common example:
<texcode>mtxrun --script font fonts --list --file all --pattern=*helvetica*</texcode>
Now, let's learn how to use them for typesetting.
= Practical application #1 - Quick use of a new font =
Let's take a an example: we want to use [https://fonts.google.com/specimen/Noto+Serif Noto Serif].
If it is already installed on your computer, and you already updated the ConTeXt databases like shown previously, go directly to '''#2'''.
</texcode>
; #2. The boring step, define the links between ''[https://github.com/contextgarden/context-mirror/blob/a0270f13065d116355a953c6f246cbba26289fc2/tex/context/base/mkiv/font-sel.lua#L514 ConTeXt basics names]'' and the ''People-readable names''.
:* It's good to add a fallback.
<texcode>
\starttypescript [mynotoserif]
\setups[font:fallback:serif] % security: if not found==> bask back to defaults% \definefontsynonym[ConTeXt bascics basics name] [Human readable] [features=default]
\definefontsynonym[Serif] [NotoSerif-Regular] [features=default]
\definefontsynonym[SerifItalic] [NotoSerif-Italic] [features=default]
# Save your file as <code>type-(fontname|foundrysome-name-you-like).tex</code>, for example here <code>type-mynotoserif.tex</code>
# Copy the typescript files into <code>tex/texmf-fonts/tex/context/user/</code>
# Run <code>context --generate</code> to update ConTeXt file database
# It's done! Now, two lines at the beginning of any input will declare to typeset with the new fonts:
<texcode>
\usetypescriptfile[mynotoserif]% this is the 'some-name-you-like' part of the saved filename\setupbodyfont[mynotoserif]% this is the first argument to \definetypeface
</texcode>
 
====Note:====
 
The naming convention for typescript files has changed in LMTX
 
<blockquote>
There has been a change in the naming of typescript file, a simple <code>"type-"</code> prefix isn't anough anymore, you have to change it to <code>"type-imp-" </code>(e.g. type-imp-sourceserif.tex) to be found by ConTeXt.
 
Valid file extensions for a typescript file in LMTX (and MkIV) are "tex", "mkiv" and "mkxl".
 
Wolfgang [20 Dec 2020]
</blockquote>
 
[[Category:Fonts]]

Navigation menu