Changes

Jump to navigation Jump to search
no edit summary
== Usage of the blocks in ConTeXt ==
A typical use of Unicode blocks is in the definition of '''fallback''' fonts to provide glyphs for certain characters. Sometimes, when writing a document in ConTeXt, one needs to typeset special symbols that are not available in the base font of the document. In such a situation, one can specify a fallback font to provide these missing symbols.  For example, in the following document, the base font [[TeX Gyre|TeX Gyre Pagella]] does not have the glyphs for Cyrillic characters, whose code points are in the Unicode block {{code|Cyrillic}}. The document uses the {{cmd|definefallbackfamily}} command to get the missing glyphs for this block from the {{code|DejaVu Serif}} font. The ConTeXt name of the block is supplied as the value of the key {{code|range}} in the last setup of the command.
<context source=yes>
\definefallbackfamily [mainface] [serif] [DejaVu Serif] [range=cyrillic,force=yes]
\definefontfamily [mainface] [serif] [TeX Gyre Pagella]
\starttext
 
\startlines
\stoplines
\rightaligned{--- Lewis Caroll, Jabberwocky} 
\startlines
\stoplines
\rightaligned {--- Дина Григорьевна Орловская, Бармаглот}
\stoptext
</context>
Another use of fallback fonts arises when one wants to replace the glyphs for some characters in the base font with glyphs for those characters from another font. In such a case, the latter font can be specified as a fallback font.
51

edits

Navigation menu