From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/69046 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: [metafun] MPenvironment / font switching Date: Thu, 9 Jun 2011 23:31:49 +0200 Message-ID: References: <20110609212057.GA3842@orcus> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v1084) Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1307655129 24824 80.91.229.12 (9 Jun 2011 21:32:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Jun 2011 21:32:09 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Thu Jun 09 23:32:05 2011 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 1QUmpd-0002cn-Rx for gctc-ntg-context-518@m.gmane.org; Thu, 09 Jun 2011 23:32:01 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 0D099CADB4; Thu, 9 Jun 2011 23:32:01 +0200 (CEST) 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 9o5cqBXUs-+r; Thu, 9 Jun 2011 23:31:57 +0200 (CEST) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 6902DCADA3; Thu, 9 Jun 2011 23:31:57 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 57B86CADA3 for ; Thu, 9 Jun 2011 23:31:56 +0200 (CEST) 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 BziVIMuvdZys for ; Thu, 9 Jun 2011 23:31:54 +0200 (CEST) Original-Received: from filter3-nij.mf.surf.net (filter3-nij.mf.surf.net [195.169.124.154]) by balder.ntg.nl (Postfix) with ESMTP id 60896CADA1 for ; Thu, 9 Jun 2011 23:31:54 +0200 (CEST) Original-Received: from mail-fx0-f41.google.com (mail-fx0-f41.google.com [209.85.161.41]) by filter3-nij.mf.surf.net (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p59LVr90032571 for ; Thu, 9 Jun 2011 23:31:53 +0200 Original-Received: by fxm18 with SMTP id 18so1800249fxm.14 for ; Thu, 09 Jun 2011 14:31:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:content-type:mime-version:subject:from :in-reply-to:date:content-transfer-encoding:message-id:references:to :x-mailer; bh=dx1fwWaKEuoQQbGMcuQienekHmOPUUTGJHLEeUyNfZo=; b=evD+Hfy6VXTd/H/2xj8HybvSiXl6QJ4rtJfJm0IqOsXzwfa1XTnd5EXhhRFpo3r5UM uK8EAjNHNThwBPokIREO2kbQRfHoXx+5fAnotSoTwMDMiDRaH5Y0nMvtD1caEbRFT4eM THRwId6zLMbpZXSkHjDV7YXyWTcHYcTf23WQQ= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to:x-mailer; b=s0WZWkYFjrcnegGudMo47fNPCzkzHseBRhHfu20OmVrXHdIxy9r7Qh571O7qcaFtFD LPwItenSTlLvhiPdK1YdKrVcvnZYUKL+8VKHOXHr8G4C1H7i0eMGWBOHxHV5uLvvF73A mHSEAL4l0onIew9CiT4WLGBtYop7XQzkfkuDE= Original-Received: by 10.223.32.142 with SMTP id c14mr1281224fad.59.1307655113073; Thu, 09 Jun 2011 14:31:53 -0700 (PDT) Original-Received: from [192.168.2.34] (p5482CF64.dip.t-dialin.net [84.130.207.100]) by mx.google.com with ESMTPS id a18sm808213fak.29.2011.06.09.14.31.51 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 09 Jun 2011 14:31:52 -0700 (PDT) In-Reply-To: <20110609212057.GA3842@orcus> X-Mailer: Apple Mail (2.1084) X-Bayes-Prob: 0.0001 (Score 0, tokens from: @@RPTN) X-CanIt-Geo: ip=209.85.161.41; 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: 0dERVvRlJ - 06fd450bc833 - 20110609 X-Scanned-By: CanIt (www . roaringpenguin . com) on 195.169.124.154 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:69046 Archived-At: Am 09.06.2011 um 23:20 schrieb Philipp Gesang: > Hi all, > = > I=92m struggling with the font used in metapost. The only way to > actually change it appears to be enclosing the mp graphic in two > statements of \setupbodyfont[=85] -- which I need to avoid. In the > following example, the background text should be typeset (drawn) > as lm sans, whereas the main font should be left untouched > (serif). > = > =B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7= =B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7= =B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7 > = > \startMPenvironment %[global] > \switchtobodyfont[sans] > %\setupbodyfont[sans] > \stopMPenvironment > = > %\start\setupbodyfont[sans] > \startuseMPgraphic{bg} > verbatimtex \setupbodyfont[sans] etex ; > draw btex I wanna get rid of those serifs! etex > xysized (21cm, 5cm) withcolor blue ; > \stopuseMPgraphic > = > \definelayer[bg][x=3D0,y=3D0,width=3D\paperwidth,height=3D\paperheight] > \setlayer[bg]{% > %\setupbodyfont[sans] > \useMPgraphic{bg} > } > \setupbackgrounds[paper][background=3Dbg] > \setupbackgrounds[state=3Drepeat] > %\stop > = > \starttext > \dorecurse{42}{I=92d really like to keep my serifs! } > \stoptext > = > =B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7= =B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7= =B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7=B7 > = > Wrapping the mp code inside a group is fatal. > \[start|stop]MPenvironment doesn=92t seem to have an effect at all > unless called with the =93global=94 flag -- in which case it will > change the main body font as well. Also, inside mp=92s > =93[verbatim|b]tex ... etex=94 font switches refuse to work. > = > I=92m really puzzled here, any hints? Thanks in advance ConTeXt postpones fontloading till \starttext, as you won=92t get any text for elements (e.g. layers) which are set before the font was loaded the typewriter font is used as fallback and this is what you get. Add =93\setupbodyfont[modern]=94 before your layer settings and switch the style in the MP graphic with =93=85 btex \ss I wanna get rid =85 etex = =85=94. Wolfgang ___________________________________________________________________________= ________ If your question is of interest to others as well, please add an entry to t= he Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-cont= ext webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________= ________