From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24068 Path: news.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.comp.tex.context Subject: Re: Is it possible to automatically determine font size to fit text to a given space? Date: Sat, 03 Dec 2005 21:10:26 +1100 Message-ID: <877jam8p9p.fsf@rimspace.net> References: <87d5kgl2q6.fsf@rimspace.net> <4390540E.3000501@wxs.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1133604661 5732 80.91.229.2 (3 Dec 2005 10:11:01 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 3 Dec 2005 10:11:01 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sat Dec 03 11:10:51 2005 Return-path: 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 1EiULv-0005Ix-0v for gctc-ntg-context-518@m.gmane.org; Sat, 03 Dec 2005 11:10:47 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3606512832; Sat, 3 Dec 2005 11:10:46 +0100 (CET) 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 27789-02; Sat, 3 Dec 2005 11:10:41 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1DCFC127F1; Sat, 3 Dec 2005 11:10:41 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 36915127F1 for ; Sat, 3 Dec 2005 11:10:39 +0100 (CET) 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 27594-04 for ; Sat, 3 Dec 2005 11:10:37 +0100 (CET) Original-Received: from anu.rimspace.net (203-217-29-35.perm.iinet.net.au [203.217.29.35]) by ronja.ntg.nl (Postfix) with ESMTP id 11CB1127D0 for ; Sat, 3 Dec 2005 11:10:36 +0100 (CET) Original-Received: by anu.rimspace.net (Postfix, from userid 10) id 7D241AFEC3; Sat, 3 Dec 2005 21:10:34 +1100 (EST) Original-Received: by enki.rimspace.net (Postfix, from userid 1000) id CB14ABB43AA4; Sat, 3 Dec 2005 21:10:27 +1100 (EST) Original-To: mailing list for ConTeXt users In-Reply-To: <4390540E.3000501@wxs.nl> (Hans Hagen's message of "Fri, 02 Dec 2005 15:02:54 +0100") User-Agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.5-b21 (corn, linux) X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 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:24068 Archived-At: Hans Hagen writes: > Daniel Pittman wrote: G'day Hans. >>Hints about that, or a native TeX method[1], would be very much >>appreciated. At the moment it is a relatively slow process of manual >>trial and error. > > this is something tex is pretty good at and it runs as fast as normal > > how does your current code look? (the solution depends a bit it); think > of something Sorry, I should have included that. The cut down version follows; I have a few more comments and so forth so I can revisit it if I wish. I didn't make any attempt to automate the process at this stage, but will have a play with all the suggestion and see if I can get it to work. For reference, this is aimed at printing multiple identical labels in each batch, rather than distinct content on each label, so I don't worry about the font size changing between the individual labels in the run or anything. Regards, Daniel \loadmapfile[ec-bitstream-vera.map] \usetypescriptfile[type-bitstream-vera] \usetypescript[fiee][bitstream-vera] \setupbodyfont[bitstream-vera, ss, 10pt] % Avery Slide labels (L7656) layout. \definepapersize[L7656][width=46.0mm,height=11.1mm] \setuppapersize [XY][A4] \setuppaper [topspace=15.9mm,backspace=6.0mm,dx=4.7mm,dy=1.6mm,nx=4,ny=21] \setuplayout [page] [topspace=15.9mm,backspace=6.0mm] \setuplayout [page] \setuplayout [location=middle] \setuparranging [XY] % The layout within the label \setuplayout[ width=fit,height=fit, header=1mm,footer=0mm,leftmargin=0mm,rightmargin=0mm, topspace=1mm,backspace=1mm, ] \setuppagenumbering[state=stop] \startbuffer[label] \vbox{20051112 \crlf Black Rock Cider} \stopbuffer \starttext % skip already printed labels \dorecurse{30}{~~\page}% % print a number of labels. \dorecurse{129}{% \bf\setupinterlinespace[line=2ex]% \startalignment[middle]% \getbuffer[label]% \stopalignment% \page} \stoptext