From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22390 Path: news.gmane.org!not-for-mail From: Peter Rolf Newsgroups: gmane.comp.tex.context Subject: Re: \limitatefirstline (or slave to the wiki) Date: Sun, 11 Sep 2005 14:39:40 +0200 Message-ID: <4324258C.9070502@gmx.net> References: <43216FD1.4020805@gmx.net> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------040605050309030108020408" X-Trace: sea.gmane.org 1126442360 27978 80.91.229.2 (11 Sep 2005 12:39:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 11 Sep 2005 12:39:20 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Sun Sep 11 14:39:19 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 1EER5p-0004nC-J3 for gctc-ntg-context-518@m.gmane.org; Sun, 11 Sep 2005 14:37:57 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id DF72F127B6; Sun, 11 Sep 2005 14:37:56 +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 23858-05; Sun, 11 Sep 2005 14:37:50 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 8DB8B1279C; Sun, 11 Sep 2005 14:37:50 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 2E3721279C for ; Sun, 11 Sep 2005 14:37:49 +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 23683-07 for ; Sun, 11 Sep 2005 14:37:47 +0200 (CEST) Original-Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by ronja.ntg.nl (Postfix) with SMTP id A8ED512783 for ; Sun, 11 Sep 2005 14:37:47 +0200 (CEST) Original-Received: (qmail invoked by alias); 11 Sep 2005 12:37:47 -0000 Original-Received: from i5387D7A8.versanet.de (EHLO [192.168.0.3]) [83.135.215.168] by mail.gmx.net (mp019) with SMTP; 11 Sep 2005 14:37:47 +0200 X-Authenticated: #24293357 User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <43216FD1.4020805@gmx.net> X-Enigmail-Version: 0.92.0.0 X-Y-GMX-Trusted: 0 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-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:22390 Archived-At: This is a multi-part message in MIME format. --------------040605050309030108020408 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Peter Rolf wrote: > Hi all, > > I've tested the latest version of \limitatefirstline and it still > doesn't work as expected. This is really a complex story (problem). > > - the clip mechanism cuts off the lowest part of some special chars > (clipping graphics is easy, but I don't understand what happens here) This one is unsolved. I added height to the clipping (\struttotal; maybe not enought for \underbar). Now I get complete characters, but the cropped text and the sentinel are not on the same baseline anymore. > - text is sometimes cropped at word boundaries (example 110pt), > instead of beeing clipped I have fixed this one. There must be another check in case of a successful break (else it acts like \limitatetext). Haven't thought about this :) So just ignore the prior mail (example) and look at the attached code instead. Greetings, Peter --------------040605050309030108020408 Content-Type: text/plain; name="crop.tex" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="crop.tex" % interface=en output=pdftex % Time-stamp: % \setupcolors[state=start] \setupstrut \unprotect %% \def\limitatefirstline#1#2#3% %% {\hbox\bgroup\strut %% \setbox\scratchbox\hbox{#1}% %% \ifdim\wd\scratchbox>#2\relax %% \setbox\scratchbox\hbox{#3}% %% \hsize#2\relax %% \advance\hsize-\wd\scratchbox %% \setbox\scratchbox\vbox{\forgetall\veryraggedright#1}% %% \setbox\scratchbox\vsplit\scratchbox to \lineheight %% \vbox %% {\unvbox\scratchbox %% \global\setbox\plusone\lastbox %% \global\setbox\plusone\hbox{\unhbox\plusone}% %% \hbox to #2 %% {\ifx\clip\undefined %% \box\plusone %% \else\ifdim\wd\plusone>\hsize %% \clip[\c!width=\hsize]{\box\plusone}% %% \else %% \box\plusone %% \fi\fi %% \removeunwantedspaces\hss#3}}% %% \else %% #1% %% \fi %% \egroup} \def\limitatefirstline#1#2#3% {\hbox\bgroup\strut \setbox\scratchbox\hbox{#1}% \ifdim\wd\scratchbox>#2\relax \setbox\scratchbox\hbox{#3}% \hsize#2\relax \advance\hsize-\wd\scratchbox \setbox\scratchbox\vbox{\forgetall\veryraggedright#1}% \setbox\scratchbox\vsplit\scratchbox to \lineheight \vbox {\unvbox\scratchbox \global\setbox\plusone\lastbox \global\setbox\plusone\hbox{\unhbox\plusone}% \hbox to #2 {\ifx\clip\undefined \box\plusone \else \ifdim\wd\plusone>\hsize \clip[\c!width=\hsize,\c!height=\struttotal]{\ruledhbox{\box\plusone}} \else \ifdim\wd\plusone<\dimexpr\hsize-2ex\relax% tolerance for "successful" breaking \clip[\c!width=\hsize,\c!height=\struttotal]{\ruledhbox{#1}}% must be #1 here \else \box\plusone \fi \fi \fi \removeunwantedspaces\hss#3}}% \else #1% \fi \egroup} \protect \def\CropSymbol{\red...}% \starttext % blue for the limitatetext examples \setupframed[offset=overlay, framecolor=lightgray] \framed[width=8ex,height=\struttotal,background=color,backgroundcolor=black]{\white 8ex} \framed{\limitatefirstline{\underbar{WqTextdummy}}{8ex}{\CropSymbol}} \framed{\limitatetext{\blue\underbar{WqTextdummy}}{8ex}{\CropSymbol}} \blank \framed[width=120pt,height=\struttotal,background=color,backgroundcolor=black]{\white 120 pt} \framed{\limitatefirstline{\textbar \_\textcircumflex\texttilde \%\$\#\textbraceleft \textbraceright \textpm \copyright \registered \pi \textdegree <>\&}{120pt}{\CropSymbol}} \framed{\limitatetext{\blue\textbar \_\textcircumflex\texttilde \%\$\#\textbraceleft \textbraceright \textpm \copyright \registered \pi \textdegree <>\&}{120pt}{\CropSymbol}} \blank \framed[width=110pt,height=\struttotal,background=color,backgroundcolor=black]{\white 110 pt} \framed{\limitatefirstline{\textbar \_\textcircumflex\texttilde \%\$\#\textbraceleft \textbraceright \textpm \copyright \registered \pi \textdegree <>\&}{110pt}{\CropSymbol}} \framed{\limitatefirstline{This text is definitely too long to fit this frame.}{110pt}{\CropSymbol}} \framed{\limitatetext{\blue This text is definitely too long to fit this frame.}{110pt}{\CropSymbol}} \blank \framed[width=100pt,height=\struttotal,background=color,backgroundcolor=black]{\white 100 pt} \framed{\limitatefirstline{\textbar \_\textcircumflex\texttilde \%\$\#\textbraceleft \textbraceright \textpm \copyright \registered\space \pi \textdegree <>\&}{100pt}{\CropSymbol}} \stoptext %%% Local Variables: %%% mode: context %%% TeX-master: "" %%% End: --------------040605050309030108020408 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ ntg-context mailing list ntg-context@ntg.nl http://www.ntg.nl/mailman/listinfo/ntg-context --------------040605050309030108020408--