From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/105564 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?B?S3JlxaFpbWlyIENpbmRyacSH?= Newsgroups: gmane.comp.tex.context Subject: ConTeXt: specify a path to font in \definefontfamily Date: Tue, 19 Nov 2019 10:50:25 +0100 Message-ID: Reply-To: kresimircindric@gmail.com, mailing list for ConTeXt users Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5292076051674754081==" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="125982"; mail-complaints-to="usenet@blaine.gmane.org" To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Wed Nov 20 08:18:41 2019 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iXKG9-000Wd9-LI for gctc-ntg-context-518@m.gmane.org; Wed, 20 Nov 2019 08:18:41 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7620D1632EE; Wed, 20 Nov 2019 08:18:19 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id upl9taIreWva; Wed, 20 Nov 2019 08:18:17 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A84871632F3; Wed, 20 Nov 2019 08:18:17 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 7B172163215 for ; Tue, 19 Nov 2019 10:50:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id MpQPBPj8Vlyj for ; Tue, 19 Nov 2019 10:50:34 +0100 (CET) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.222.51; helo=mail-ua1-f51.google.com; envelope-from=kresimircindric@gmail.com; receiver= Original-Received: from mail-ua1-f51.google.com (mail-ua1-f51.google.com [209.85.222.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id C03C1163211 for ; Tue, 19 Nov 2019 10:50:34 +0100 (CET) Original-Received: by mail-ua1-f51.google.com with SMTP id r13so6306821uan.6 for ; Tue, 19 Nov 2019 01:50:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:reply-to:from:date:message-id:subject:to; bh=rRDL1w+7gbJd8zZJlMVV02KCJoMUIFM6eVZVuUd9Co8=; b=A8urusvMolWECrix+6FPGC+rIPnNLhqGoy2/GK06vWRdz5NIQcqR6I5V7Y3HgKegT0 qoMj0wYTmgOC1etpIKCJVXorLjmsrBtOp5Pj0FEp8pNqSA+TvZbymymsFxyXPfet41vl mFUZHfsdyl9bBJ7bFefhM58RQ73Lt/W1xongf0qlFdLu1HV9Ahxt5C1L3IAFXyH4OVNA 4SEpUQX07S/nnz+kSDYYZZvgpUfFwVrxHFz4+X+qiKBy9E3IQypPLd4Uo1kAOcJEts6O 9dhYfWj0RsHyscY+1NA1ZdvyGU4FpEXerBIIVoDkohZcr1rKO/8DtYRPiUhLYBYy59/d IQWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:reply-to:from:date:message-id :subject:to; bh=rRDL1w+7gbJd8zZJlMVV02KCJoMUIFM6eVZVuUd9Co8=; b=AbSdJQeVT8eCab7/SCcuh+pRJgfEOgAbZ8W+J8nIwP4c8aPkY1kJz20F9zaqhUNJPr oFqc81JOLz0h5AWsPC9KLaJYW6KbIaMa5bOBaub+epDgW/sAwA8aaOnCOG2Pw1EaRzHk gpXYLiL8o+8ksoA+2PVoNZVTRK/F1v6IUGKhQY2CLyZhmz8evKn0FNUM6HHLhdSGY8Dk nwjTom4Wyc/UmJPTWBCxpWxEyKJFGUN5FInAr5YNX4EcWMaJmweDMPoivwRHhzHLLhlw ucV8xFn9zaYAynUn/Ndun15Y5T3Y/9FQZgmNIjFEWBQD1znnaJnf8uRNb5I9gIYkvnVA zJgg== X-Gm-Message-State: APjAAAWmiz1WJMWqYCyh7XxKvk9ATpEhiS4tHwpXsf5dAkpz/3cgfNVK qOEJarBpF6r9pubqjmPZ7cMS7JzUqAoOC7IKbcYQjHke X-Google-Smtp-Source: APXvYqxaF3WccaB7+Vf1Eus996Wqdbn/YhIxObaxqwePCI4K5MMNaF2bqdcndXvCKAA9VxbaTvd67iqxqpt06gv8IQg= X-Received: by 2002:ab0:334c:: with SMTP id h12mr20183098uap.37.1574157032227; Tue, 19 Nov 2019 01:50:32 -0800 (PST) X-Mailman-Approved-At: Wed, 20 Nov 2019 08:18:17 +0100 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.26 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:105564 Archived-At: --===============5292076051674754081== Content-Type: multipart/alternative; boundary="000000000000ba086f0597affece" --000000000000ba086f0597affece Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable I'm *very* new to ConTeXt, so please excuse the newbie question. I'm trying to load a font from a file. The .otf files are stored in a directory named fonts/ which is in the directory of the .tex file I'm trying to compile. This code does not work, and reverts to the default font: \definefontfamily [mainface][serif] [My Font] [tf=3Dfile:./fonts/MyFont.otf, it=3Dfile:./fonts/MyFont-It.otf, bf=3Dfile:./fonts/MyFont-Bd.otf, bi=3Dfile:./fonts/MyFont-BdIt.otf] \setupbodyfont[mainface] \starttext\title{Hello, world!} Hello World! \emph{Hi!} \stoptext However, if I copy the .otf files into the same directory as the .tex file, and write tf=3Dfile:MyFont.otf etc, then everything works fine. How do I specify a relative path to the font, inside the .tex file? In LaTeX, I would use fontspec package and do the following: \setmainfont {MyFont.otf} [Path =3D./fonts/, ItalicFont =3D MyFont-It.otf] However, I couldn't find the equivalent syntax for \definefontfamily in ConTeXt. Just to mention, I am using ConTeXt version: 2019.03.21 21:39 as part of TeX Live, on Manjaro Linux. Regards, Kre=C5=A1imir --000000000000ba086f0597affece Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

I'm very new to ConTeXt, so please excuse the newbie questi= on. I'm trying to load a font from a file. The .otf files = are stored in a directory named fonts/ which is in the directo= ry of the .tex file I'm trying to compile.

This code does not work, and reverts to the default font:

<=
span class=3D"gmail-kwd">\definefontfamily=
 [mainfac=
e][serif<=
/span>] <=
span class=3D"gmail-pun">[My Font]
                  [tf=3Dfile:./fonts/MyFont.otf,
                   it=3Dfile:./fonts/MyFont-It.otf,
                   bf=3Dfile:./fonts/MyFont-Bd.otf,
                   bi=3Dfile:./fonts/MyFont-BdIt.otf]

\setupbodyfont[mainface]                  =20

\starttext
\title{Hello, world!}

Hello World! \emph{Hi!}

\stoptext

However, if I copy the .otf files into the same directory a= s the .tex file, and write tf=3Dfile:MyFont.otf e= tc, then everything works fine.

How do I specify a relative path to the font, inside the .tex file?

In LaTeX, I would use fontspec package and do the following= :

<=
span class=3D"gmail-kwd">\setmainfont {MyFont.otf}
             [Path        =3D./fonts/,
              ItalicFont  =3D MyFont-It.otf]=

However, I couldn't find the equivalent syntax for \definefont= family in ConTeXt.

Just to mention, I am using ConTeXt version: 2019.03.21 21:39 as part of= TeX Live, on Manjaro Linux.


Regards,

Kre=C5=A1imir
--000000000000ba086f0597affece-- --===============5292076051674754081== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fCg== --===============5292076051674754081==--