From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/24033 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: Is it possible to automatically determine font size to fit text to a given space? Date: Fri, 02 Dec 2005 16:30:00 +0100 Message-ID: <43906878.6090908@wxs.nl> References: <87d5kgl2q6.fsf@rimspace.net> <4390540E.3000501@wxs.nl> <439065D0.70807@student.kuleuven.be> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1133537599 23680 80.91.229.2 (2 Dec 2005 15:33:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 2 Dec 2005 15:33:19 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Dec 02 16:33:17 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 1EiCrO-0000FK-TY for gctc-ntg-context-518@m.gmane.org; Fri, 02 Dec 2005 16:30:07 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A844D128F8; Fri, 2 Dec 2005 16:30:06 +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 15097-07-10; Fri, 2 Dec 2005 16:30:01 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DCC3312864; Fri, 2 Dec 2005 16:30:01 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id A0A3C12864 for ; Fri, 2 Dec 2005 16:30:00 +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 15097-07-9 for ; Fri, 2 Dec 2005 16:29:59 +0100 (CET) Original-Received: from controller-1 (dsl-212-84-128-085.solcon.nl [212.84.128.85]) by ronja.ntg.nl (Postfix) with ESMTP id 9CDB01282C for ; Fri, 2 Dec 2005 16:29:59 +0100 (CET) Original-Received: from [10.100.1.102] (unverified [10.100.1.102]) by controller-1 (SurgeMail 3.5b3) with ESMTP id 6054 for ; Fri, 02 Dec 2005 16:35:17 +0300 User-Agent: Mozilla Thunderbird 1.0.7 (Windows/20050923) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <439065D0.70807@student.kuleuven.be> X-Server: High Performance Mail Server - http://surgemail.com r=-274017400 X-Authenticated-User: hagen@controller-1 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:24033 Archived-At: Wolfgang Zillig wrote: > Could't it be done by metapost? > no, that is overkill, but what can be done is: \startbuffer the label \stopbuffer \externalfigure[buffer][factor=max] or \scale[factor=max]{\framed[align=normal]{the label text}} that would scale each label to fit best but it would look funny (all those different sizes) a more clever solution would choose different sizes for different label components depending on the result (there is a rudimentary strategy mechanism, one day i will perfect that, which can be used to optimize whole documents, think of manipulating the distance in columns, or fontsizes in order to stick within a certain amount of pages; pretty old and rusty code btw) > Wolfgang > > Hans Hagen schrieb: > >> Daniel Pittman wrote: >> >>> 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 >> >> \doloop{ >> \setbox\scratchbox=\vbox >> {the content of the label} >> \ifx\ht\scratchbox>10cm >> \switchtobodyfont[small] \else >> \unvbox\scratchbox >> \exitloop >> \fi >> } >> >> Hans >> _______________________________________________ >> ntg-context mailing list >> ntg-context@ntg.nl >> http://www.ntg.nl/mailman/listinfo/ntg-context >> > > _______________________________________________ > ntg-context mailing list > ntg-context@ntg.nl > http://www.ntg.nl/mailman/listinfo/ntg-context