From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24002 Path: news.gmane.org!not-for-mail From: Daniel Pittman Newsgroups: gmane.comp.tex.context Subject: Is it possible to automatically determine font size to fit text to a given space? Date: Fri, 02 Dec 2005 12:14:25 +1100 Message-ID: <87d5kgl2q6.fsf@rimspace.net> 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 1133530305 29654 80.91.229.2 (2 Dec 2005 13:31:45 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Dec 2005 13:31:45 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Dec 02 14:31:36 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 1EiAxy-0004HZ-Hq for gctc-ntg-context-518@m.gmane.org; Fri, 02 Dec 2005 14:28:46 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 5040F12907; Fri, 2 Dec 2005 14:24:28 +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 11579-08-55; Fri, 2 Dec 2005 14:24:25 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id C901A12910; Fri, 2 Dec 2005 14:20:53 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 1EDCF12816 for ; Fri, 2 Dec 2005 14:18:13 +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 11172-01-18 for ; Fri, 2 Dec 2005 14:18:11 +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 610C71291C for ; Fri, 2 Dec 2005 02:14:34 +0100 (CET) Original-Received: by anu.rimspace.net (Postfix, from userid 10) id 95956AFE26; Fri, 2 Dec 2005 12:14:32 +1100 (EST) Original-Received: by enki.rimspace.net (Postfix, from userid 1000) id 413BFBB43AA1; Fri, 2 Dec 2005 12:14:26 +1100 (EST) Original-To: ntg-context@ntg.nl 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:24002 Archived-At: G'day. One of the things I (ab)use ConTeXt for is printing little text labels to Avery stock. This works quite well, and I was pleasantly surprised how easy it was to get working with some hints from Hans in the archives of this list. The labels, over time, have varying lengths of text on them, and to get that to fit on a single label sometimes requires that I vary the font size to avoid the text spilling over outside the bounding box. Is there any reasonable way that I could automate the process of adjusting the font size so that I got the biggest possible size while keeping the text fully fitted to the label? I don't mind automating this outside of TeX/ConTeXt, by using a script to try the font sizes and examine the TeX output for overflow messages, but I don't know quite what to look for. 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. Regards, Daniel Footnotes: [1] I don't care if it takes ten minutes to run, since this isn't a performance critical job.