From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/31523 Path: news.gmane.org!not-for-mail From: Wolfgang Schuster Newsgroups: gmane.comp.tex.context Subject: Re: character width Date: Tue, 24 Oct 2006 20:45:57 +0200 Message-ID: <20061024204557.0a06517b.schuster.wolfgang@googlemail.com> References: <2C25F9DC-49B1-4E1F-9892-B54C6E5626CC@st.estfiles.de> <453E0D2D.9030205@elvenkind.com> <85FDEEB1-451F-4435-87DE-F3E9CAF2E028@st.estfiles.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1161715641 18911 80.91.229.2 (24 Oct 2006 18:47:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 24 Oct 2006 18:47:21 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Tue Oct 24 20:47:11 2006 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 ciao.gmane.org with esmtp (Exim 4.43) id 1GcRIB-0002Gu-9g for gctc-ntg-context-518@m.gmane.org; Tue, 24 Oct 2006 20:46:27 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B459E1FEB9; Tue, 24 Oct 2006 20:46:26 +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 31087-04-3; Tue, 24 Oct 2006 20:46:19 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id E69DC1FEB0; Tue, 24 Oct 2006 20:46:17 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2FB581FEB1 for ; Tue, 24 Oct 2006 20:46:17 +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 31087-04-2 for ; Tue, 24 Oct 2006 20:46:10 +0200 (CEST) Original-Received: from nf-out-0910.google.com (nf-out-0910.google.com [64.233.182.186]) by ronja.ntg.nl (Postfix) with SMTP id B3F601FEA3 for ; Tue, 24 Oct 2006 20:46:10 +0200 (CEST) Original-Received: by nf-out-0910.google.com with SMTP id d4so274871nfe for ; Tue, 24 Oct 2006 11:46:10 -0700 (PDT) Original-Received: by 10.48.254.1 with SMTP id b1mr1773709nfi; Tue, 24 Oct 2006 11:46:09 -0700 (PDT) Original-Received: from unknown ( [194.94.240.124]) by mx.google.com with ESMTP id c1sm1743920nfe.2006.10.24.11.46.08; Tue, 24 Oct 2006 11:46:09 -0700 (PDT) Original-To: ntg-context@ntg.nl In-Reply-To: <85FDEEB1-451F-4435-87DE-F3E9CAF2E028@st.estfiles.de> X-Mailer: Sylpheed version 2.2.6 (GTK+ 2.6.10; i686-pc-mingw32) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.7 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:31523 Archived-At: On Tue, 24 Oct 2006 18:39:22 +0200 Steffen Wolfrum wrote: > Yes, that's it. Thank you! > > But can it also be defined in a more handy \MySpace[999] ? > Sorry, I tried some \def ... but didn't succeed. > > Steffen > > > > Am 24.10.2006 um 14:55 schrieb Taco Hoekwater: > > > > > > > Steffen Wolfrum wrote: > >> Hi, > >> > >> for fine-adjusting I need to have a variable horizontal space > >> sometimes the width of "999" sometimes of "1", for example. > >> Is there a command that reads the width of a character so it can be > >> used in some kind of horizontal space? > > > > There is a \fontcharwd primitive to measure the width of a single > > character is a specific font: > > > > \hskip \the\fontcharwd \font `1 > > > > but it may be easier to put the number(s) in a box and measure the > > width of that: > > > > \setbox\scratchbox=\hbox{999}% > > \hskip \the\wd \scratchbox > > > > Greetings, Taco Hi Steffen, your solution based on the method provided by Taco. \def\MySpace {\dosingleempty\doMySpace} \def\doMySpace[#1]% {\setbox\scratchbox=\hbox{#1}% \unskip\hskip \the\wd \scratchbox} \starttext Text\MySpace[999]Text Text\MySpace[999] Text Text \MySpace[999]Text Text \MySpace[999] Text \stoptext Wolfgang