ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Zhichu Chen <zhichu.chen@gmail.com>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: Is there a replacement for \tracechinesetrue in mkiv?
Date: Thu, 29 Dec 2011 11:22:34 +0800	[thread overview]
Message-ID: <CAAxCdXOu1AZLsz+nkmtY2SwZUba6KtoERhdpkC982WGPO6StBQ@mail.gmail.com> (raw)
In-Reply-To: <4EF261F6.8040204@wxs.nl>

All right, after some readings, I came out with a node solution. The
major idea is listed below and works just fine. "n" from node_traverse
(head) and n.id==node.id ('glyph')

My question is: is there a better way? Because these codes are so
dirty. I prefer mplib but I have no clue how to do that.

=============================================
          local ht,wd,dp = n.height,n.width,n.depth ;
          local rwd = .5*65536
          local k1 = node.new('kern')
          k1.kern = -wd-.5*rwd
          local r1 = node.new("rule")
          r1.width, r1.height, r1.depth = rwd, ht, dp
          local k2 = node.new('kern')
          k2.kern = -r1.width
          local r2 = node.new("rule")
          r2.width, r2.height, r2.depth = wd+rwd, ht+.5*rwd, -ht+.5*rwd
          local k3 = node.new('kern')
          k3.kern = -r2.width
          local r3 = node.new("rule")
          r3.width, r3.height, r3.depth = wd+rwd, -dp+.5*rwd, dp+.5*rwd
          local k4 = node.new('kern')
          k4.kern = -.5*rwd
          local r4 = node.new("rule")
          r4.width, r4.height, r4.depth = rwd, ht, dp
          local k5 = node.new('kern')
          k5.kern = -.5*rwd
          k1.next = r1
          r1.prev = k1
          r1.next = k2
          k2.prev = r1
          k2.next = r2
          r2.prev = k2
          r2.next = k3
          k3.prev = r2
          k3.next = r3
          r3.prev = k3
          r3.next = k4
          k4.prev = r3
          k4.next = r4
          r4.prev = k4
          r4.next = k5
          k5.prev = r4
          local box = node.hpack(k1)
          local tb = node.vpack(box)
          insert_after (head, n, tb)
=============================================

On Thu, Dec 22, 2011 at 6:47 AM, Hans Hagen <pragma@wxs.nl> wrote:
> On 21-12-2011 12:16, Zhichu Chen wrote:
>>
>> Hi,
>>
>> I wrote some CJK vertical typesetting macros in mkii a long time ago
>> and I want to adopt it to mkiv. Sadly the \iftracechinese is gone. Can
>> I still draw boxes of each glyph to see if they are aligned in my way?
>> Drawing a line in the background is so not cool.
>
>
> mkiv does things completely different
>
> Hans
>
>
>
> -----------------------------------------------------------------
>                                          Hans Hagen | PRAGMA ADE
>              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
>    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
>                                             | www.pragma-pod.nl
> -----------------------------------------------------------------



-- 
Best Regards
Chen
___________________________________________________________________________________
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
___________________________________________________________________________________

  parent reply	other threads:[~2011-12-29  3:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-21 11:16 Zhichu Chen
2011-12-21 22:47 ` Hans Hagen
2011-12-22  1:00   ` Zhichu Chen
2011-12-29  3:22   ` Zhichu Chen [this message]
2011-12-29 14:18     ` Hans Hagen
2011-12-30 15:52       ` Zhichu Chen
2011-12-29 14:38     ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAAxCdXOu1AZLsz+nkmtY2SwZUba6KtoERhdpkC982WGPO6StBQ@mail.gmail.com \
    --to=zhichu.chen@gmail.com \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).