From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/95669 Path: news.gmane.org!.POSTED!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \typescriptthree within the optional argument of \definefontsynonym Date: Thu, 04 Aug 2016 15:43:43 +0200 Message-ID: <57A3468F.4010609@gmail.com> References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0515761616517383843==" X-Trace: blaine.gmane.org 1470318279 14361 195.159.176.226 (4 Aug 2016 13:44:39 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 4 Aug 2016 13:44:39 +0000 (UTC) User-Agent: Postbox 4.0.8 (Macintosh/20151105) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Aug 04 15:44:34 2016 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 esmtp (Exim 4.84_2) (envelope-from ) id 1bVIwm-0002P0-06 for gctc-ntg-context-518@m.gmane.org; Thu, 04 Aug 2016 15:44:28 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 537DA144BC; Thu, 4 Aug 2016 15:44:01 +0200 (CEST) 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 ELQ0jX9UVo-w; Thu, 4 Aug 2016 15:43:59 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 67C0C144BF; Thu, 4 Aug 2016 15:43:59 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id E03EB144BC for ; Thu, 4 Aug 2016 15:43:58 +0200 (CEST) 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 QVLtaiIH1yRx for ; Thu, 4 Aug 2016 15:43:58 +0200 (CEST) Original-Received: from mail-wm0-f48.google.com (mail-wm0-f48.google.com [74.125.82.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 6B9F9144B9 for ; Thu, 4 Aug 2016 15:43:48 +0200 (CEST) Original-Received: by mail-wm0-f48.google.com with SMTP id p129so2636216wmp.0 for ; Thu, 04 Aug 2016 06:43:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:subject:references :in-reply-to; bh=46P6rLeVwiMf+4KxWz772tN0oXr82v0l4jTIYfvVbcg=; b=gFjPesWh9LcL6BbknGEds+EKl4fJI3PtUCLqMzHu70u1Tmzi2rPeYsgEypjz7L/ohn o5Bci1b535THE/OrE0/E9BppLq/0YqiOiZ1ySZRot6rDHLsdQdlCz8TwTLhYtRrYXXX9 BpoW9ziVDQuF8JEHXG9c9bZh3c3fmosaH/vDcyMhK7orZuYrTnpA7zaqIcJypt+BafWv 4YwNFdxNZa/qZsPfF1oHKPp1QrJJt5qK1T3SvzzmyFmMpjPjNofV71+kZOZLyK5Gi/7u B6B7lctowoyVVqsiFrEo9kkcLplZwRCezE4lJG8OAStWvW6RO21RYRrajiQySnd5PSHP Driw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :subject:references:in-reply-to; bh=46P6rLeVwiMf+4KxWz772tN0oXr82v0l4jTIYfvVbcg=; b=E799+O+J6mXNALLI69bXPw+uxvWpvaFPYothOT0vLydonMGdKk8VgolaBESt2WsoKK M+F/ydy7vQUkfIOzt0GSZ8fWwQ9hyHrxLzBdjH5mSAcltQq0R7mdec6gg6gWWXUvov8e yXbQnxq/6kFHHbdhyWxubPrJYn4Y7QHSgEj+o9sXK7mjSqHkn2YbO6nZ5h4pxN8fUMBc 8wjYuAPu6GYXjd7ReLPH8xqQslgoYNlUk5dQDjxfL+PSNR0GMerB+6gNIhulDQoJeomg 4XLXeJcfPCMUH7bOdpJ+t5JLsN/9I7uLHeIJ9ZW9Unb5i2mtPIA9EjuWUNmZh7F86R1n f+SA== X-Gm-Message-State: AEkooutZFypwqRepXuSwxRYeEGRLLheVP9pTZR3i+uZYvbDf/3ntPaXIcWM+xUd8KlkeTw== X-Received: by 10.194.238.170 with SMTP id vl10mr68114067wjc.18.1470318227509; Thu, 04 Aug 2016 06:43:47 -0700 (PDT) Original-Received: from keima.localdomain (x2f238db.dyn.telefonica.de. [2.242.56.219]) by smtp.gmail.com with ESMTPSA id v203sm3766126wmv.2.2016.08.04.06.43.46 for (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 04 Aug 2016 06:43:46 -0700 (PDT) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 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:95669 Archived-At: This is a multi-part message in MIME format. --===============0515761616517383843== Content-Type: multipart/alternative; boundary="------------030605030408020806090003" This is a multi-part message in MIME format. --------------030605030408020806090003 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > Mohammad Hossein Bateni > 4. August 2016 um 15:24 > Hello Hans, > > Suppose you have a typescript as follows. > > \starttypescript [first] [MyFont] [GoodieOne,GoodieTwo] > \definefontsynonym [Serif] [\typescripttwo] [goodies=\typescriptthree] > \stoptypescript > > Using macros \typescriptX (for X=one, two, and three) works in the > first and second arguments in \definefontsynonym but not in the > optional argument. This seems to be because the optional argument is > not expanded. Is this a bug or a feature? > > What I want to do was have a set of "fixes" (correcting kern issues, > etc.) for a collection of fonts. I can either put these in separate > goodie files or feature sets (the latter being what I was trying but > not in the sample above), and write generic typescripts that would > load any of the fonts with its associated fixes. > > While I can use sans/serif/mono in the first argument, and name of the > font in the second argument (to be mapped appropriately using > \typescriptprefix to nmemonic name and real font name), the third > (optional) argument of \definefontsynonym does not expand immediately, > hence I'll end up with "undefined" \typescriptthree when it will be used. You can try to expand the value of \typescripthree with \starttypescript[...][...][...] \expanded{\definefontsynonym[...][...][goodies=\typescriptthree]} \expanded{\definefontsynonym[...][...][goodies=\typescriptthree]} \stoptypescript or \starttypescript[...][...][...] \startexpanded \definefontsynonym[...][...][goodies=\typescriptthree] \definefontsynonym[...][...][goodies=\typescriptthree] \stopexpanded \stoptypescript Wolfgang --------------030605030408020806090003 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit
4. August 2016 um 15:24
Hello Hans,

Suppose you have a typescript as follows.

\starttypescript [first] [MyFont] [GoodieOne,GoodieTwo]
  \definefontsynonym [Serif] [\typescripttwo] [goodies=\typescriptthree]
\stoptypescript

Using macros \typescriptX (for X=one, two, and three) works in the first and second arguments in \definefontsynonym but not in the optional argument.  This seems to be because the optional argument is not expanded.  Is this a bug or a feature?

What I want to do was have a set of "fixes" (correcting kern issues, etc.) for a collection of fonts.  I can either put these in separate goodie files or feature sets (the latter being what I was trying but not in the sample above), and write generic typescripts that would load any of the fonts with its associated fixes.

While I can use sans/serif/mono in the first argument, and name of the font in the second argument (to be mapped appropriately using \typescriptprefix to nmemonic name and real font name), the third (optional) argument of \definefontsynonym does not expand immediately, hence I'll end up with "undefined" \typescriptthree when it will be used.
You can try to expand the value of \typescripthree with

\starttypescript[...][...][...]
    \expanded{\definefontsynonym[...][...][goodies=\typescriptthree]}
    \expanded{\definefontsynonym[...][...][goodies=\typescriptthree]}
\stoptypescript

or

\starttypescript[...][...][...]
    \startexpanded
        \definefontsynonym[...][...][goodies=\typescriptthree]
        \definefontsynonym[...][...][goodies=\typescriptthree]
    \stopexpanded
\stoptypescript

Wolfgang
--------------030605030408020806090003-- --===============0515761616517383843== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly90ZXguYWFuaGV0Lm5ldAphcmNoaXZlICA6IGh0dHA6Ly9mb3VuZHJ5LnN1cGVsZWMu ZnIvcHJvamVjdHMvY29udGV4dHJldi8Kd2lraSAgICAgOiBodHRwOi8vY29udGV4dGdhcmRlbi5u ZXQKX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX18= --===============0515761616517383843==--