From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/55103 Path: news.gmane.org!not-for-mail From: Hans Hagen Newsgroups: gmane.comp.tex.context Subject: Re: actualtext and encoding Date: Mon, 07 Dec 2009 11:21:00 +0100 Message-ID: <4B1CD70C.3090909@wxs.nl> References: <7D1033ED-9DA6-4D0D-ABBD-B4ECEEE11580@googlemail.com> <4B1CB442.4090804@elvenkind.com> <4B1CC0EA.3060102@wxs.nl> <10F4CE4E-4B3D-4A2B-B310-C2E537053459@googlemail.com> <4B1CC6B9.1070504@wxs.nl> <1C7EE4E6-FD92-4242-8014-84AC5BEB00D7@googlemail.com> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1260181291 23110 80.91.229.12 (7 Dec 2009 10:21:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Dec 2009 10:21:31 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Dec 07 11:21:24 2009 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from balder.ntg.nl ([195.12.62.10]) by lo.gmane.org with esmtp (Exim 4.50) id 1NHaiZ-0006X9-IE for gctc-ntg-context-518@m.gmane.org; Mon, 07 Dec 2009 11:21:23 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id CCB1AC9C33; Mon, 7 Dec 2009 11:21:22 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 3nTtAsUTy8f5; Mon, 7 Dec 2009 11:21:11 +0100 (CET) Original-Received: from balder.ntg.nl (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id AF9C4C9C01; Mon, 7 Dec 2009 11:21:10 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by balder.ntg.nl (Postfix) with ESMTP id 9AD08C9C01 for ; Mon, 7 Dec 2009 11:21:06 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at balder.ntg.nl Original-Received: from balder.ntg.nl ([127.0.0.1]) by localhost (balder.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Bw-wsveOxk12 for ; Mon, 7 Dec 2009 11:21:03 +0100 (CET) Original-Received: from mail.solcon.net (dsl-083-247-100-017.solcon.nl [83.247.100.17]) by balder.ntg.nl (Postfix) with ESMTP id 66B4BC9BF1 for ; Mon, 7 Dec 2009 11:21:03 +0100 (CET) X-Default-Received-SPF: pass (skip=loggedin (res=PASS)) x-ip-name=10.100.1.100; Original-Received: from [10.100.1.100] (unverified [10.100.1.100]) by controller-9 (SurgeMail 4.2a3) with ESMTP id 10599-1713362 for ; Mon, 07 Dec 2009 11:19:28 +0100 User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) In-Reply-To: <1C7EE4E6-FD92-4242-8014-84AC5BEB00D7@googlemail.com> X-Authenticated-User: hagen@controller-9 X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.12 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 Xref: news.gmane.org gmane.comp.tex.context:55103 Archived-At: Wolfgang Schuster wrote: > Am 07.12.2009 um 10:11 schrieb Hans Hagen: > >> hm, doesn't that kind of functionality demands a bit more 'thinking'? what exactly is needed? how does it relate to linebreaks? other content? etc .. actually, such a mechanism should be implemented a bit differently (maybe attributes and delayed processing) or maybe dictionary driven .. > > there is no linebreak in the text because it's a boxed content, a simple version of my macro is > > \def\pdfactualtext#1#2% > {\pdfliteral direct{/Span <> BDC}#1\pdfliteral direct{EMC}} > > \def\ruby#1#2% > {\dontleavehmode\bgroup > \setbox\scratchboxone\hbox{#1}% > \setbox\scratchboxtwo\hbox{#2}% > \scratchdimen\wd\scratchboxone > \setbox\scratchbox\vbox > {\hbox to \scratchdimen{\hss\box\scratchboxtwo\hss} > \hbox to \scratchdimen{\hss\box\scratchboxone\hss}}% > \pdfactualtext{\box\scratchbox}{#1 (#2)}% > \egroup} > > \starttext > > text \ruby{base text}{ruby text} text > > \stoptext detail ... \def\ruby#1#2% {\dontleavehmode\bgroup \setbox\scratchboxone\hbox{#1}% \setbox\scratchboxtwo\hbox{#2}% \scratchdimen\wd\ifdim\wd\scratchboxone>\wd\scratchboxtwo\scratchboxone\else\scratchboxtwo\fi \setbox\scratchbox\vbox {\hbox to \scratchdimen{\hss\box\scratchboxtwo\hss} \hbox to \scratchdimen{\hss\box\scratchboxone\hss}}% \pdfactualtext{\box\scratchbox}{#1 (#2)}% \egroup} \starttext text \ruby{lua text}{ruby or perl text which is more blabla} text \stoptext ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl ----------------------------------------------------------------- ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : http://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________