From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/64478 Path: news.gmane.org!not-for-mail From: Marco Newsgroups: gmane.comp.tex.context Subject: Re: bold small caps Date: Mon, 13 Dec 2010 11:38:08 +0100 Message-ID: <20101213113808.0142c72f@glyph> References: <20101211224016.GA19735@micropit.couberia.bzh> <20101211231209.GA20105@micropit.couberia.bzh> <7D80EFE8-87AB-4BA5-B295-45F5B8B0D7CF@gmail.com> <20101212162244.55a2f946@glyph> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292236725 27252 80.91.229.12 (13 Dec 2010 10:38:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 13 Dec 2010 10:38:45 +0000 (UTC) To: ntg-context@ntg.nl Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 13 11:38:42 2010 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PS5nl-0007o1-05 for gctc-ntg-context-518@m.gmane.org; Mon, 13 Dec 2010 11:38:41 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id B8AEECA8D8; Mon, 13 Dec 2010 11:38:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id nO3u3QJIIZZF; Mon, 13 Dec 2010 11:38:37 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 34C97CA8D1; Mon, 13 Dec 2010 11:38:37 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id DBEF9CA8D1 for ; Mon, 13 Dec 2010 11:38:35 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id z+mupBOP32Mw for ; Mon, 13 Dec 2010 11:38:31 +0100 (CET) Original-Received: from filter1-til.mf.surf.net (filter1-til.mf.surf.net [194.171.167.217]) by balder.ntg.nl (Postfix) with ESMTP id B7CE8CA8CC for ; Mon, 13 Dec 2010 11:38:31 +0100 (CET) Original-Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by filter1-til.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id oBDAcURk000865 for ; Mon, 13 Dec 2010 11:38:31 +0100 Original-Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1PS5nX-0007hu-NO for ntg-context@ntg.nl; Mon, 13 Dec 2010 11:38:27 +0100 Original-Received: from 83.68.239.197 ([83.68.239.197]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Dec 2010 11:38:27 +0100 Original-Received: from netuse by 83.68.239.197 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 13 Dec 2010 11:38:27 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 44 Original-X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: 83.68.239.197 X-Newsreader: Claws Mail 3.7.6 (GTK+ 2.22.0; x86_64-pc-linux-gnu) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=80.91.229.12; country=NO; latitude=62.0000; longitude=10.0000; http://maps.google.com/maps?q=62.0000,10.0000&z=6 X-CanItPRO-Stream: uu:ntg-context@ntg.nl (inherits from uu:default, base:default) X-Canit-Stats-ID: 08DGyCusp - faa3c79a923b - 20101213 X-Scanned-By: CanIt (www . roaringpenguin . com) on 194.171.167.217 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:64478 Archived-At: On 2010-12-12 Wolfgang Schuster wrote: > > Maybe it is possible that the \sc macro can check if the font contains the > > small caps as a feature. Is there a switch like > > \doiffontfeatureexists{smcp}{...}? > > \startluacode > function commands.doifelsecurrentfonthasfeature(name) > local f = fonts.identifiers[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")}} > > \let\normalsc\sc > \definefontfeature[smcp][smcp=yes] > \definefontfeature[latn][script=latn] > > \unexpanded\def\sc{\doifelsecurrentfonthasfeature{smcp}{\addfs{smcp}}\normalsc} > > \starttext > > \tf text \sc text > > \switchtobodyfont[cambria]\addfs{latn} % cambria needs the latin script for > smallcaps > > \tf text \addfs{smcp} text > > \switchtobodyfont[modern] > > \tf text \sc text > > \stoptext That's a nice piece of code! Thanks for your effort. Marco ___________________________________________________________________________________ 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 : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________