On Fri, May 29, 2015 at 2:55 AM, Wolfgang Schuster wrote:
>> Am 28.05.2015 um 21:39 schrieb Mojca Miklavec:
>>
>> Hi,
>>
>> Can someone please help me remind how to automatically "replace" a
>> Greek letter (gamma (γ) in particular, but I wouldn't mind if the
>> whole alphabet would be replaced) with $\mathgreekupright γ$.
>>
>> The OpenType font (Lucida) doesn't have Greek characters (except for
>> maybe μ), but the math alphabets in the math font are complete, so I
>> would like to automatically use the characters from the Greek math in
>> main text (possibly upright math in upright text and italic math in
>> italic text).
>>
>> Of course I can always create a shortcut for $\mathgreekupright γ$ but
>> it would be great if things like "γ rays" or "α particles" would be
>> typeset "automatically“.
>
>
> You can use the fallback mechanism for fonts but I don’t there are problems
> (e.g. missing kerning) when you use the math font as fallback.
>
> \definefallbackfamily [textmojca] [rm] [Gentium] 
> [scale=1.15,range={greekandcoptic,greekextended}]
> \definefontfamily     [textmojca] [rm] [Lucida Bright OT]
> \definefontfamily     [textmojca] [mm] [Lucida Bright Math OT]
>
> \definefallbackfamily [mathmojca] [rm] [Lucida Bright Math OT] 
> [range=lowercasegreeknormal]
> \definefontfamily     [mathmojca] [rm] [Lucida Bright OT]
> \definefontfamily     [mathmojca] [mm] [Lucida Bright Math OT]
>
> \starttext
>
> \switchtobodyfont[textmojca]
>
> \startlines
> alpha: α
> beta: β
> gamma: γ
> \stoplines
>
> \switchtobodyfont[mathmojca]
>
> \startlines
> alpha: α
> beta: β
> gamma: γ
> \stoplines
>
> \stoptext

Perfect, thank you. Kerning is not a problem as the glyphs won't be
used for typesetting Greek.

Is there also some way to handle italic with "mathmojca"? (Taking the
glyphs from gentium works, but taking them from the math font only
works with bold, it doesn't work with italic.)

\startlines
alpha: α
beta: β
gamma: γ
\it
alpha: α ($α$)
beta: β ($β$)
gamma: γ ($γ$)
\bf
alpha: α
beta: β
gamma: γ
\stoplines

Mojca
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to