ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Gerben Wierda <gerben.wierda@rna.nl>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: How do I add cyrillic to my typescript/document?
Date: Mon, 4 May 2020 18:38:48 +0200	[thread overview]
Message-ID: <53C018F0-069A-4265-9AD4-80A73AB6D258@rna.nl> (raw)
In-Reply-To: <cb12557c-d00e-dae3-fa35-ee727e321c53@gmx.es>

On 4 May 2020, at 12:13, Pablo Rodriguez <oinos@gmx.es> wrote:
> 
> On 5/4/20 12:36 AM, Gerben Wierda wrote:
>> [...]
>> It could help if I would understand ConTeXt better. The link gives me a
>> grammar for a command, but doesn’t tell me what to put in.
>> 
>> I tried many, many different permutations, I tried everything I could
>> find on ConTeXtgarden (but then, that also finds me stuff from 15 years
>> ago that isn’t valid anymore), but no luck so far.
> 
> Sorry for not explaining it better, Gerben.
> 
> Let me know if the following sample works for you:
> 
>  \setuplanguage[en][patterns={en, ru}]
> 
>  \definefallbackfamily
>    [abc]
>    [ss]
>    [Helvetica]
>    [preset=range:cyrillic,
>     %~ tf=style:light,
>     %~ it=style:lightoblique,
>     %~ bf=style:regular,
>     %~ bi=style:oblique,
>     force=yes,
>     rscale=0.9]
> 
>  \definefontfamily [abc] [ss] [Optima]
> 
>  \setupbodyfont[abc]
> 
>  \starttext
>  \startTEXpage[offset=1em]
>  \doloopoverlist{\tf, \it, \bf, \bi}{
>  \recursestring\hyphenatedword{Николаевич typography}\par}
>  \stopTEXpage
>  \stoptext
> 
> It should hyphenate both English and Russian in all four fonts (regular,
> italic, bold and bold italic).

The above works (including using macOS Helvetica as the font for cyrillic). Thank you.

I have no idea why (earlier I got the typescript suggestion for my fonts management, but this uses another approach). Is it the case that the ‘family’ and ’typescript’ approaches don’t really mix? The above is a lot simpler than that what I had and it works fine.

Any reason to leave these commented? And does uncommenting is plan TeX-uncommenting, so only the % goes away? Makes me wonder what ‘~’ means.

>     %~ tf=style:light,
>     %~ it=style:lightoblique,
>     %~ bf=style:regular,
>     %~ bi=style:oblique,

What I try to do is to have english as the default (and fallback) language and Optima as the default font, but there may be snippets in other languages which should be typeset in a font that can handle cyrillic. Helvetica is an option. So is dejavu.

I still am totally in the dark how this works and what made the earlier setup find Optima but not find Helvetica. 

And I’m curious why this adaptation doesn’t work:

 \definefallbackfamily
   [abc]
   [ss]
   [dejavu]
   [preset=range:cyrillic,
    %~ tf=style:light,
    %~ it=style:lightoblique,
    %~ bf=style:regular,
    %~ bi=style:oblique,
    force=yes,
    rscale=0.9]


Anyway, I can go on, not wiser but helped further. Thanks again.

G


> 
>> Which is weird because Optima.ttc is in the same directory and it is found.
> 
> Aren’t Optima.ttc and Helvetica.ttc installed as typefaces on your macOS?
> 
> This is relevant, since ConTeXt may have problems finding them when not
> installed on the system (especially with the system I use).
> 
> If the sample above doesn’t work, please provide the output of "locate
> Helvetica.ttc".
> 
>> But anyway, even if I could understand it, I can’t find anything useful
>> (that is: something that works or makes me try something that works)
>> about font fallbacks. Spending hours of looking (losing a lot of sleep)
>> and then having to bother the list again is very frustrating. Why isn’t
>> this straightforward? I am sorry, everybody is very helpful, but the
>> frustration mounts again.
> 
> If the sample above works, I think font management for your documents
> may be easier to handle (or at least, the font code will be simpler).
> 
> Don’t loose sleep when code is not working, ask here instead. I must
> admit that not having access to a macOS computer (I needed the help of a
> friend to test) makes everything a bit harder. But it isn’t impossible.
> 
> BTW, I use "preset=range:cyrillic" instead of "range=cyrillic", since it
> includes cyrillic, cyrillicextendeda, cyrillicextendedb and
> cyrillicsupplement.
> 
> I hope the sample above helps now,
> 
> Pablo
> --
> http://www.ousia.tk
> ___________________________________________________________________________________
> 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://context.aanhet.net
> archive  : https://bitbucket.org/phg/context-mirror/commits/
> wiki     : http://contextgarden.net
> ___________________________________________________________________________________

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  reply	other threads:[~2020-05-04 16:38 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-03 11:34 Gerben Wierda
2020-05-03 12:56 ` Gerben Wierda
2020-05-03 13:55   ` Pablo Rodriguez
2020-05-03 22:36     ` Gerben Wierda
2020-05-04  2:37       ` Vladimir Lomov
2020-05-04  6:14       ` Henning Hraban Ramm
2020-05-04 10:13       ` Pablo Rodriguez
2020-05-04 16:38         ` Gerben Wierda [this message]
2020-05-04 22:49           ` Pablo Rodriguez

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53C018F0-069A-4265-9AD4-80A73AB6D258@rna.nl \
    --to=gerben.wierda@rna.nl \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).