Difference between revisions of "Fonts/Use the fonts you want"
< Fonts
Jump to navigation
Jump to search
m (Garulfo moved page Use fonts not provided by the distribution to Use fonts not provided by the distribution (2020) without leaving a redirect) |
|||
Line 1: | Line 1: | ||
− | + | = Quick use of a new font = | |
− | = | ||
− | |||
− | |||
Let's take a example, we want to use [https://fonts.google.com/specimen/Noto+Serif Noto Serif]. The google website enable us to download a zip file with the 4 alternative styles: | Let's take a example, we want to use [https://fonts.google.com/specimen/Noto+Serif Noto Serif]. The google website enable us to download a zip file with the 4 alternative styles: | ||
Line 34: | Line 31: | ||
[[File:result_of_test_with_noto-serif_one.png]] | [[File:result_of_test_with_noto-serif_one.png]] | ||
− | + | = Use of the different variations = | |
; #1. Define them as a new typescript (ConTeXt vocabulary) in your input file. | ; #1. Define them as a new typescript (ConTeXt vocabulary) in your input file. |
Revision as of 16:43, 1 June 2020
Quick use of a new font
Let's take a example, we want to use Noto Serif. The google website enable us to download a zip file with the 4 alternative styles:
- Regular 400
- Regular 400 italic
- Bold 700
- Bold 700 italic
- #1. Store them is a dedicated folder
-
- create a "Noto-serif" in the ConTeXt distribution
tex/texmf-fonts
. - unzip and store the .ttf file in
tex/texmf-fonts/Noto-serif/
.
- create a "Noto-serif" in the ConTeXt distribution
- #2. Regenerate ConTeXt databases
-
- the file database:
mtxrun --generate
- the fonts database:
mtxrun --script font --reload
- and check the situation
mtxrun --script font --list --file -pattern=*noto*
:
- the file database:
familyname weight style width variant fontname filename subfont fontweight notoserif bold normal normal normal notoserifbold NotoSerif-Bold.ttf notoserif bold italic normal normal notoserifbolditalic NotoSerif-BoldItalic.ttf notoserif normal italic normal normal notoserifitalic NotoSerif-Italic.ttf notoserif normal normal normal normal notoserif NotoSerif-Regular.ttf
- #3. Your are done! You can use the font anywhere on in your input files.
-
- Use the commands \definedfont
\definedfont[file:NotoSerif-BoldItalic at 12pt] The quick brown fox jumps over the lazy dog
Use of the different variations
- #1. Define them as a new typescript (ConTeXt vocabulary) in your input file.
-
- Use the commands \starttypescript and \definefontsynonym to declare
\starttypescript [serif] [notoserif] \definefontsynonym[NotoSerif-Regular] [file:NotoSerif-Regular] \definefontsynonym[NotoSerif-Italic] [file:NotoSerif-Italic] \definefontsynonym[NotoSerif-Bold] [file:NotoSerif-Bold] \definefontsynonym[NotoSerif-BoldItalic] [file:NotoSerif-BoldItalic] \stoptypescript
- #2. Define them as part of your font family, here as a roman
\definefontfamily [MyFontIdentifier] [rm] [notoserif]
- #3. You are done! Finally, we have the following input file
\starttypescript [serif] [notoserif] \definefontsynonym[NotoSerif-Regular] [file:NotoSerif-Regular] \definefontsynonym[NotoSerif-Italic] [file:NotoSerif-Italic] \definefontsynonym[NotoSerif-Bold] [file:NotoSerif-Bold] \definefontsynonym[NotoSerif-BoldItalic] [file:NotoSerif-BoldItalic] \stoptypescript \definefontfamily [MyFontIdentifier] [rm] [notoserif] \setupbodyfont[MyFontIdentifier] \setupbodyfont[12pt] {\rm The quick brown fox jumps over the lazy dog}\\ {\rm\bf The quick brown fox jumps over the lazy dog}\\ {\rm\it The quick brown fox jumps over the lazy dog}\\
And it gives: