Open main menu

Changes

2,120 bytes removed ,  18 May
no edit summary
{| class= How to use one of the provided fonts"wikitable" style="margin:auto; width: 4 steps, 10 sec. = 100%; #1. First, be aware of the [[ConTeXt distribution's Fonts|21 fonts provided]].":* If required, you can [[Mtxrun#fonts| regenerate the font database]] <code>mtxrun --script font --reload --force</code> ; #2. Give a name to the set of fonts you want to use and select a first font! style="width:* Use the command {{cmd50%"|definefontfamily}}.:* Let's take an example, for a Serif font, for which TeX practice is to refer to them as '''roman''' Tutorials (=rmlearning)! style="width:* <texcode>\definefontfamily[MyFontIdentifier][rm][refcode to the serif font]</texcode> ; #3. Declare it as your default font family for your document:* Use the command with {{cmd50%"|setupbodyfont}}:* <texcode>\setupbodyfont[MyFontIdentifier]</texcode> ; #4. Specify the font size:* <texcode>\setupbodyfont[xxpt]</texcode> To learn how How-to use different alternative styles of a given font, like regular / bold / italic, see the [[Font_Switching]] in the [[Basics]]. == Example =={{TwoColumnsUnderLevel1guides (goals)|Let see what give the defaults:<context source=yes>\setupbodyfont[12pt]{The quick brown fox jumps over the lazy dog}\\{\bf The quick brown fox jumps over the lazy dog}\\{\it The quick brown fox jumps over the lazy dog}\\</context>-
|
And let* [https://meeting.contextgarden.net/2021/talks/2021-09-23/typescripts-presentation.pdf ''s add the two lines, using Tex Gyre Pagella Serif font Handling fonts in ConTEXt (ref:texgyrepagella2021)''] ConTEXt-Meeting 15th, 2021, Willi Egger, 38 invaluable slides* [https://articles.contextgarden.net/journal/2018/83-94.pdf <context source=yesi>\definefontfamily [MyFontIdentifier] [rm] [texgyrepagella]\setupbodyfont[MyFontIdentifier]\setupbodyfont[12pt]{The quick brown fox jumps over the lazy dog}\\{\bf The quick brown fox jumps over the lazy dog}\\{\it The quick brown fox jumps over the lazy dog}\\Font installation example: IBM Plex (2018)</contexti>] by Taco Hoekwater and Pavneet Arora}}|
= How to use more than one of the provided fonts: 1 step, 5 sec. = ; #1. Very similarly to above, just select a second font:* for a Sans Serif font, for which TeX practice is to refer to them as '''Sans Serif''' (=ss):* <texcode>\definefontfamilySee below on this [MyFontIdentifier][ssFonts#How-to_guides|Fonts central page][refcode to the sans serif font]</texcode>:* for a monospaced font, for which TeX practice is to refer to them as '''TypewriTer''' (=tt):* <texcode>\definefontfamily[MyFontIdentifier][tt:Category:Fonts | Wiki pages in Fonts category][refcode to the monospaced font]</texcode>|- == Example =={{TwoColumnsUnderLevel1! Explanation (understanding) !! Reference (information)|This basic input is typeset with the default font, Latin Modern:<context source=yes>\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}\\\\{\ss The quick brown fox jumps over the lazy dog}\\{\ss\bf The quick brown fox jumps over the lazy dog}\\{\ss\it The quick brown fox jumps over the lazy dog}\\\\{\tt The quick brown fox jumps over the lazy dog}\\{\tt\bf The quick brown fox jumps over the lazy dog}\\{\tt\it The quick brown fox jumps over the lazy dog}\\</context>-
|
And by adding the two lines discussed above* [http://www.pragma-ade.nl/general/manuals/fonts-mkiv.pdf 2016 Fonts manual, and using all the reference to Tex Gyre Pagella Serif font (texgyrepagella) we obtain:<context source=yes>\definefontfamily [MyFontIdentifier] [rm] [texgyrepagelladetails]for advanced users\definefontfamily * [MyFontIdentifier] [ss] [texgyreadventorhttp://context.aanhet.net/svn/contextman/context-reference/en/co-fonts.pdf the 2013 font chapter]as a separate document\definefontfamily * [MyFontIdentifier] [tt] [texgyrecursor]\setupbodyfont[MyFontIdentifier]\setupbodyfont[12pt]http://pmrb.free.fr/contextref.pdf#&#91;145,{\rm The quick brown fox jumps over the lazy dog%22name%22:%22Fit%22}\\{\rm\bf The quick brown fox jumps over &#93; 2013 reference manual] never officially released, with the lazy dog}\\{\rm\it The quick brown fox jumps over the lazy dog}\\2013 font chapter\\| {\ss The quick brown fox jumps over the lazy dog}\\{\ss\bf The quick brown fox jumps over the lazy dog}\\{\ss\it The quick brown fox jumps over the lazy dog}\\\\{\tt The quick brown fox jumps over the lazy dog}\\{\tt\bf The quick brown fox jumps over the lazy dog}\\{\tt\it The quick brown fox jumps over the lazy dog}\\<[[:Category:Command/context>}}Fonts | commands in Fonts category]]|- = How to use my new font = {{todo:How to use font from your system.|}} Let's take a example, we want to use [https://fonts.google.com/specimen/Noto+Serif Noto Serif].
; #1. Download :*The google website enable us = How-to download a zip file with the 4 alternative styles::** Regular 400:** Regular 400 italic:** Bold 700:** Bold 700 italicguides =
; #* '''[[Fonts/Use fonts distributed with ConTeXt| Use fonts distributed with ConTeXt]]'''** How to use the [[Fonts/ConTeXt distribution's Fonts|21 provided fonts]].** These are the basics you may want to start with, in 2or 3 steps, less than 3 minutes. Store them is a dedicated folder* '''[[Fonts/Use_the_fonts_you_want| Use any other font ]]'''** Case 1:* create a Quick "Noto-serifone shot" in the ConTeXt distribution (<code>tex5min.)** Case 2: Comprehensive approach (~10min.)* '''[[Fonts/texmfFont Switching| "Font Switching", or "how-to use the different fonts<within your document"]]'''** how to define font size, ** how to use alternative styles like regular / bold / italic /code>small caps** how to switch between serif, sans serif, monospaced, or to another fonts with {{cmd|switchtobodyfont}}** how to underline, strike...* '''[[Visual_Debugging#Fonts_and_Type | Visual help and debugging]]''' for Fonts* '''[[Fonts/Featuresets|OpenType features]]''' for some common options for {{cmd|definefontfeature}} like:** '''[[Fonts/Ligatures|Ligatures]]'''** unzip and store '''[[Fonts/Protrusion]]''' (also known as hanging or font handling)* '''[[Fonts/Typescripts examples|Typescripts examples]]'''* Technical details** [[Fonts/Optical Size | How to set up a font family with optical size options]]** [[Fonts/Fontsize | What defines the size in a font]] ('natural' size.ttf file in <code>tex'design' size)** Get examples from [https://source.contextgarden.net/texmf?search=s-fonts- s-fonts/Noto-seriffiles], that you can compile and/</code>.or use as module for own fonts (with lua font goodies)
; #3. Regenerate ConTeXt databases:* the file database: <code>mtxrun --generate</code>:* the fonts database: <code>mtxrun --script font --reload</code>== To tidy ==
; #4* Work is also needed to merge content from [[Fonts/Fonts_in_LuaTeX| Fonts in LuaTeX]] in the pages above. Find how are called the 4 styles for ConTeXt::* <code>mtxrun For older content, refering to mkii, we keep a [[Fonts --script font --list --file -pattern=*noto*</code>Old Content|specific zone in the wiki]].
; #5. Define them as a new typescript (ConTeXt vocabulary):* Use the command {{cmd|starttypescript}}.:* <texcode>\starttypescript [serif] [notoserif] \definefontsynonym[NotoSerif-Regular] [fileCategory:NotoSerif-RegularFonts] \definefontsynonym[NotoSerif-Italic] [file:NotoSerif-Italic] \definefontsynonym[NotoSerif-Bold] [file:NotoSerif-Bold] \definefontsynonym[NotoSerif-BoldItalic] [file:NotoSerif-BoldItalic]\stoptypescript</texcode>
1,017

edits