[NTG-context] Typesetting modern Greek (UTF8) with ConTeXt

Pablo Rodriguez oinos at gmx.es
Mon Jun 6 19:14:41 CEST 2022


On 6/6/22 02:19, Gerben Wierda via ntg-context wrote:
> For Russian I have:
> 
> \setuplanguage[ru][patterns={ru}]\mainlanguage[ru]
> \definefallbackfamily
>   [archimate]
>   [ss]
>   [Helvetica]
>   [preset=range:cyrillic,
>    tf=style:light,
>    it=style:lightoblique,
>    bf=style:regular,
>    bi=style:oblique,
>    force=yes,
>  rscale=1.0]
> \definefontfamily [archimate] [ss] [Optima]
> \setupbodyfont[archimate]
> 
> I can’t find out from ConTeXtgarden what code I must use for modern
> Greek (‘el’?) and what range I must use for Greek characters (I guess
> ‘greekandcoptic’ which I’ve seen mentioned somewhere).
> 
> Correct?

Hi Gerben,

\language[gr], but beware since it uses patterns for ancient Greek.

preset=range:greek is what you intend.

Another approach would be to use \setuplanguage[gr] and configure the
font in setups.

Here you have a minimal sample with both approaches:

    \mainlanguage[en]
    \definefallbackfamily
      [archimate]
      [ss]
      [MgOpenCosmetica]
      [preset=range:greek,
       force=yes]
    \definefontfamily [archimate] [ss] [Optima]
    \setupbodyfont[archimate]

    \definefontfamily
      [mgopencosm]
      [ss]
      [MgOpenCosmetica]
      [preset=range:greek,
       force=yes]
    \startsetups[greek-typeface]
        \switchtobodyfont[mgopencosm]
    \stopsetups

    \setuplanguage[agr][setups={greek-typeface}]

    \startbuffer
    Ο κόσμος θα ήταν απίστευτα φτωχός αν δεν υπήρχαν οι
    Έλληνες. Μάλιστα, αν θέλουμε να είμαστε ειλικρινείς, δεν θα
    υπήρχε καθόλου κόσμος, χωρίς τις επιστήμες, τη δημοκρατία,
    τις πόλεις, τα φωνήεντα, τη φέτα, το φραπέ, το ούζο και το
    χταποδάκι στα κάρβουνα.
    \stopbuffer

    \starttext
    \gr \getbuffer\par
    \agr \getbuffer
    \stoptext

MgOpenCosmetica can be downloaded from
https://web.archive.org/web/20090309063533/www.ellak.gr/fonts/mgopen/index.en.html
(direct link:
https://web.archive.org/web/20090309063533/www.ellak.gr/fonts/mgopen/files/MgOpenCosmetica.tar.gz).

Just in case it might help,

Pablo


More information about the ntg-context mailing list