[NTG-context] Font selection ranges

Khaled Hosny khaledhosny at eglug.org
Fri Sep 30 16:42:27 CEST 2011


On Thu, Sep 29, 2011 at 09:58:07PM +0200, Hans Aberg wrote:
> I want to define an environment for computer code including non-ASCII
> characters, using Xits or STIXGeneral except in the ASCII range, where
> some monospace font like Courier should be used.
> 
> If I do:
> \setupbodyfont[xits,10pt]
> \definetyping[code]
> \setuptyping[code][margin=yes]
> 
> \starttext
>   \startcode
>  for ∀i, j ∈ I
>    do a(i, j) ≔ b(i, j)
>   \stopcode
> \stoptext
> 
> Then the math characters won't show. They will show using
>   \setuptyping[code][style=normal,margin=yes]
> but then the ASCII range isn't monospace.
> 
> In LaTeX, one can use \setmathfont[range={"0001-...,}] to set ranges
> for fonts, but I could not find that for ConTeXt.

You can use the fallback feature, but then you've to define your own
typescripts, see font-col.mkiv for examples.

Regards,
 Khaled

-- 
 Khaled Hosny
 Egyptian
 Arab


More information about the ntg-context mailing list