From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/50088 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: \doiffontfeature Date: Thu, 7 May 2009 15:22:02 +0200 Message-ID: <832CD176-07A6-445B-86CA-AD79A14113E8@gmail.com> References: <38671EEC-9A7D-4AB5-8C96-DF6AB839ABF1@gmail.com> <4A02DB98.6030006@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v930.3) Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1241702641 7679 80.91.229.12 (7 May 2009 13:24:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 7 May 2009 13:24:01 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu May 07 15:23:51 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1M23Zg-0004BT-Su for gctc-ntg-context-518@m.gmane.org; Thu, 07 May 2009 15:23:44 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2ED341FDED; Thu, 7 May 2009 15:23:41 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 25909-02; Thu, 7 May 2009 15:22:50 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 9573B1FDFC; Thu, 7 May 2009 15:22:49 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B30A31FDFC for ; Thu, 7 May 2009 15:22:47 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 21055-04 for ; Thu, 7 May 2009 15:22:37 +0200 (CEST) Original-Received: from filter4-nij.mf.surf.net (filter4-nij.mf.surf.net [195.169.124.155]) by ronja.ntg.nl (Postfix) with ESMTP id A27181FDED for ; Thu, 7 May 2009 15:22:37 +0200 (CEST) Original-Received: from yw-out-1718.google.com (yw-out-1718.google.com [74.125.46.155]) by filter4-nij.mf.surf.net (8.13.8/8.13.8/Debian-3) with ESMTP id n47DMa2n004134 for ; Thu, 7 May 2009 15:22:36 +0200 Original-Received: by yw-out-1718.google.com with SMTP id 5so430385ywm.74 for ; Thu, 07 May 2009 06:22:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:mime-version :subject:date:references:x-mailer; bh=/Ou+CDygvEvgRZ1VnrWxrCYhgN2MmJHQE6cTVZH0et0=; b=Qw2FjGhMU5jEP+UdkvLCaEvgfq+Tj9QLnouhYhwuk8zY2TjkhT8p5GfBVeM7YOxtKZ 1dbhFgIkUDl6Ny12tRxPiyntgXgcAIRBhvLmE8H1qAmStjn1+2tWIadwif04yBJhLbNp Xz6OzFqcVwbU0VrA5RGVx/KJGRDn6XgA2O620= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:from:to:in-reply-to:content-type :content-transfer-encoding:mime-version:subject:date:references :x-mailer; b=HMPvs11Lw3OvPWhmL736zxThAamBoHKSFLlTkkpfKY/Go17etDDBW7ccBrXIVnFOzj ciChIvG5n3XvCw882iFw71z7OEPIDnIiYxiA+m7TFullcYIK/hIlbtdtOKElrBLJogC5 +pz0SXBVA2bQJ6x7PThHTzlax3+cJFeUPAV1M= Original-Received: by 10.90.105.6 with SMTP id d6mr2111694agc.14.1241702555366; Thu, 07 May 2009 06:22:35 -0700 (PDT) Original-Received: from ?10.40.19.184? ([82.113.121.145]) by mx.google.com with ESMTPS id 21sm188252agd.11.2009.05.07.06.22.32 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 07 May 2009 06:22:34 -0700 (PDT) In-Reply-To: <4A02DB98.6030006@wxs.nl> X-Mailer: Apple Mail (2.930.3) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=74.125.46.155; country=US; region=CA; city=Mountain View; postalcode=94043; latitude=37.4192; longitude=-122.0574; metrocode=807; areacode=650; http://maps.google.com/maps?q=37.4192,-122.0574&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 221119299 - 96626dd33840 - 20090507 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.155 X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.11 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:50088 Archived-At: Am 07.05.2009 um 15:01 schrieb Hans Hagen: > Wolfgang Schuster wrote: >> Hi, >> is it possible to check if a font has a certain feature like >> smallcaps? > > \startluacode > function commands.doifelsecurrentfonthasfeature(name) > local f = fonts.ids[font.current()] > f = f and f.shared > f = f and f.otfdata > f = f and f.luatex > f = f and f.features > commands.doifelse(f and (f.gpos[name] or f.gsub[name])) > end > \stopluacode > > \def\doifelsecurrentfonthasfeature#1% > {\ctxlua{commands.doifelsecurrentfonthasfeature("#1")}} > > \doifelsecurrentfonthasfeature{smcp}{YES}{NO} > \doifelsecurrentfonthasfeature{crap}{YES}{NO} > \doifelsecurrentfonthasfeature{kern}{YES}{NO} Nice, I will keep this in mind. > for arbitrary fonts by names is doable but tricky in the sense that > we then need to load the font which is costly Can you show me the code, this is what I'm interested in and the check did only happen once at the begin of the document. Wolfgang ___________________________________________________________________________________ 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://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________