ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Vladimir Lomov <lomov.vl@yandex.ru>
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 10:37:20 +0800	[thread overview]
Message-ID: <20200504023720.GA838@smoon.bkoty.ru> (raw)
In-Reply-To: <D310CA8B-63BC-4AD6-8B71-0ABCFC996840@rna.nl>


[-- Attachment #1.1.1: Type: text/plain, Size: 6073 bytes --]

Hello,
** Gerben Wierda <gerben.wierda@rna.nl> [2020-05-04 00:36:11 +0200]:

> On 3 May 2020, at 15:55, Pablo Rodriguez <oinos@gmx.es> wrote:
>> 
>> On 5/3/20 2:56 PM, Gerben Wierda wrote:
>>> ConTeXtgarden had theanswer when I searched again:
>>> 
>>> \setupbodyfont[dejavu]
>>> \mainlanguage[russian]
>> 
>> Hi Gerben,
>> 
>> I’m afraid they may be different issues: setting a language and getting
>> the glyphs required for that language.
>> 
>> See the following sample:
>> 
>>    \setupbodyfont[dejavu]
>>    \mainlanguage[russian]
>>    \starttext
>>    \hyphenatedword{%
>>    Николаевич
>>    typography
>>    \en typography}
>>    \stoptext
>> 
>> Since you set the main language to Russian in the document, you would
>> have to mark all English texts properly. I doubt this may be what you
>> intend.
>> 
>> The way to get a fallback font would be (depending on which approach you
>> use) \definefontfallback or \definefallbackfamily.
>> 
>> A sample of the second option would read:
>> 
>>  \definefallbackfamily
>>    [mainface]
>>    [ss]
>>    [FreeSans]
>>    [preset=range:cyrillic,
>>     force=yes]
>> 
>> In any case,
>> http://www.pragma-ade.com/general/qrcs/setup-en.pdf#search=%22definefontfallback%22
>> explains the syntax of the first option (sorry, but I only use the
>> \definefontfamily approach).
>> 
>> Just in case it helps,

> Thank you.

> 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.

Prepare a (small) example, for example.

> 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.

> The last I tried was

> \starttypescript [sans] [optima]
>    \setups[font:fallback:sans]
>    \definefontsynonym [Sans]           [file:Optima.ttc(Optima Regular)]     [features=default]
>    \definefontsynonym [SansBold]       [file:Optima.ttc(Optima Bold)]        [features=default]
>    \definefontsynonym [SansItalic]     [file:Optima.ttc(Optima Italic)]      [features=default]
>    \definefontsynonym [SansBoldItalic] [file:Optima.ttc(Optima Bold Italic)] [features=default]
> \stoptypescript

> \definetypeface [optima] [ss] [sans] [optima] [default]
> \definetypeface [optima] [rm] [serif] [optima] [default]
> \definetypeface [optima] [tt] [mono] [modern] [default]
> \definetypeface [optima] [mm] [math] [pagella] [default]

>   \definefallbackfamily
>     [optima]
>     [ss]
>     [file:Helvetica.ttc]
>     [preset=range:cyrillic,
>     force=yes]

> \setupbodyfont [optima]

> The error is:

> fonts           > typescripts > unknown library 'optima'
> open source     > level 3, order 6, name '/usr/local/context-osx-64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
> close source    > level 3, order 6, name '/usr/local/context-osx-64/tex/texmf-context/tex/context/fonts/mkiv/type-imp-texgyre.mkiv'
> selectfont      > the requested fallback font 'file:Helvetica.ttc' for typeface 'optima' style 'ss' was ignored because no files where found.

> Which is weird because Optima.ttc is in the same directory and it is found.

Note that log says about "Helvetica.ttc" not "Optima.ttc". Why you mention it
is it a typo and you mean "Helvetica.ttc"? I'm not sure how context searches
for fonts, but when I plainly use "standard" locations for fonts, for example
OSFONTDIR variable, it could find and use requested font.

> I have a lot o difficulty understanding any of the documentation (as far as
> it is available for the subjects and commands I am lookng for).

> For instance: what is the difference between the “Syntax (autogenerated)”
> and “Syntax entries on ConTeXtgarden? If they differ which one should I
> take? If you tell me “preset=range:cyrillic and what I find says
> "range=cyrillic", which one do I use ( in this case, changing did not help).
> There are just too many things that can be different for tial and error to
> be effective.

> 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.

I couldn't help here because I understand better the LaTeX font mechanism than
ConTeXt one but I don't use ConTeXt as often as LaTeX. If I understand
correctly, fallback mechanism allows to use some "main" font for most of
letters in a document, for example, for Latin letters and use another font, if
some letters are missing from "main" one. The "missing" is based on letters
codes, see "range" above.

Your original question is a bit unclear to me. Do you want typeset document
with Cyrillic letters, for example Russian text or just want to include some
words using Cyrillic (Russian) letters? The former assumes that you will use
\mainlanguage[ru] and appropriate font with Cyrillic glyphs, while for the
latter you need only the font.

I'm not a Mac OS user neither I have Optima nor Helvetica fonts, but Computer
Modern Unicode (OTF) and OldStandard (OTF) have both Cyrillic and Latin
letters (OldStandard doesn't have support "out of box" in context while
Computer Modern Unicode has) so I made two small examples (well, the first
example not so small, sometimes I prepare example not only for others but for
myself too) which show both uses. Both fonts can be found on ctan:
https://ctan.org/pkg/cm-unicode and https://ctan.org/pkg/oldstandard.

> G

---
WBR, Vladimir Lomov

-- 
Girls marry for love.  Boys marry because of a chronic irritation that
causes them to gravitate in the direction of objects with certain curvilinear
properties.
		-- Ashley Montagu

[-- Attachment #1.1.2: rus-text.tex --]
[-- Type: application/x-tex, Size: 6693 bytes --]

[-- Attachment #1.1.3: mixed-text.tex --]
[-- Type: application/x-tex, Size: 172 bytes --]

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

[-- Attachment #2: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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  2:37 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 [this message]
2020-05-04  6:14       ` Henning Hraban Ramm
2020-05-04 10:13       ` Pablo Rodriguez
2020-05-04 16:38         ` Gerben Wierda
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=20200504023720.GA838@smoon.bkoty.ru \
    --to=lomov.vl@yandex.ru \
    --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).