From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/94755 Path: news.gmane.org!not-for-mail From: "Meer, Hans van der" Newsgroups: gmane.comp.tex.context Subject: Re: definebodyfontenvironment Date: Sat, 14 May 2016 19:13:41 +0000 Message-ID: <25B3B06C-2EB5-48A9-8C8C-1865827277DC@uva.nl> References: <46179FCC-3835-4C8A-B154-CB51D5079B44@uva.nl> <573767D9.80406@gmail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8700135165663397586==" X-Trace: ger.gmane.org 1463253259 2148 80.91.229.3 (14 May 2016 19:14:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 14 May 2016 19:14:19 +0000 (UTC) To: NTG ConTeXt Original-X-From: ntg-context-bounces@ntg.nl Sat May 14 21:14:04 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 plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1b1f0k-0008Qi-Mb for gctc-ntg-context-518@m.gmane.org; Sat, 14 May 2016 21:14:02 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B3D2EC124; Sat, 14 May 2016 21:13:54 +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 zE2C8Bk93EGb; Sat, 14 May 2016 21:13:54 +0200 (CEST) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 0D50AC18F; Sat, 14 May 2016 21:13:54 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id BB520C124 for ; Sat, 14 May 2016 21:13:52 +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 nxQMLjmXmAWT for ; Sat, 14 May 2016 21:13:52 +0200 (CEST) Original-Received: from HUB01.uva.nl (hub01.uva.nl [146.50.108.230]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 4747AC11A for ; Sat, 14 May 2016 21:13:42 +0200 (CEST) Original-Received: from MBX02.uva.nl ([169.254.2.29]) by HUB01.uva.nl ([2002:9232:6737::9232:6737]) with mapi id 14.03.0279.002; Sat, 14 May 2016 21:13:42 +0200 Thread-Topic: [NTG-context] definebodyfontenvironment Thread-Index: AQHRrfj8Utk6MMMEjkeeyU4P3AyK6p+4l6iAgAAUUQA= In-Reply-To: <573767D9.80406@gmail.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [84.106.134.200] x-endpointsecurity-0xde81-ev: v:6.2.7.719, d:out, a:y, w:t, t:0, sv:1463236756, ts:1463253222 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:94755 Archived-At: --===============8700135165663397586== Content-Language: en-US Content-Type: multipart/alternative; boundary="_000_25B3B06C2EB548A98C8C1865827277DCuvanl_" --_000_25B3B06C2EB548A98C8C1865827277DCuvanl_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I think I did not state the problem clear enough. The solution given here supposes that the fontsize is known beforehand. However, what I am doing is calculating a font size based on the current on= e and than switch to that size. It is part of a fontsize changing mechanism inside an xmlsetup. In short wh= at I am doing is: \scratchdimen=3D\the\dimexpr\bodyfontsize\relax \advance\scratchdimen 'somevalue' \relax % \definebodyfontenvironment[\the\scratchdimen] \begingroup % must keep the change local \switchtobodyfont[\the\scratchdimen] ... \endgroup The commented out \definebodyfontenvironment kills a lot of the font messag= es but I fear that each the time the same work is done as without it. The o= nly benefit being the suppression of the font messages in the log ;-) It might be impossible to accomplish this efficiently -- that is execute th= e font calculations once only for the given size. But at least I would like= to give it a try. Hans van der Meer On 14 May 2016, at 20:00, Wolfgang Schuster > wrote: Meer, Hans van der 14. Mai 2016 um 17:55 I like to execute this statement \definebodyfontenvironment[somevalue] in order to avoid lots of error messages as such: fonts > bodyfont '8.0pt' is defined (can better be done global Is this definebodyfontenvironment macro fully executed each time it is call= ed or does ConTeXt remember and execute it once only? Just put it at the begin of the document. \definebodyfontenvironment[18pt] \starttext \dorecurse{10} {\begingroup \switchtobodyfont[18pt] \endgroup} \stoptext Wolfgang ___________________________________________________________________________= ________ --_000_25B3B06C2EB548A98C8C1865827277DCuvanl_ Content-Type: text/html; charset="iso-8859-1" Content-ID: <8483C1C5761431438C540743FF3873B9@uva.nl> Content-Transfer-Encoding: quoted-printable I think I did not state the problem clear enough.
The solution given here supposes that the fontsize is known= beforehand.
However, what I am doing is calculating a font size based o= n the current one and than switch to that size.
It is part of a fontsize changing mechanism inside an xmlse= tup. In short what I am doing is:

\scratchdimen=3D\the\dimexpr\bodyfon= tsize\relax
\advance\scratchdimen 'somevalue' \r= elax
% \definebodyfontenvi= ronment[\the\scratchdimen]
\begingroup
% must keep the change local<= /div>
\switchtobodyfont[\the\scratchdimen]=
...
\endgroup

The commented out \definebodyfontenvironment kills a lot of= the font messages but I fear that each the time the same work is done as w= ithout it. The only benefit being the suppression of the font messages in t= he log ;-)

It might be impossible to accomplish this efficiently -- th= at is execute the font calculations once only for the given size. But at le= ast I would like to give it a try.

Hans van der Meer




On 14 May 2016, at 20:00, Wolfgang Schuster <schuster.wolfgang@gmail.com<= /a>> wrote:

14. Mai 2016 um 17:55
I like to execute this st= atement
\definebodyfontenvironment[somevalue= ]
in order t= o avoid lots of error messages as such:
fonts > bodyfont '8.0pt' is defined (can better be done glo= bal

Is this definebodyfontenvironment macro fully executed each time it is called or does ConTeXt remember and execute it once only?
Just put it at the begin of the document.

\definebodyfontenvironment[18pt]

\starttext

\dorecurse{10}
  {\begingroup
   \switchtobodyfont[18pt]
   \endgroup}

\stoptext

Wolfgang
___________________________________________________________________________= ________

--_000_25B3B06C2EB548A98C8C1865827277DCuvanl_-- --===============8700135165663397586== 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= --===============8700135165663397586==--