ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
To: ntg-context@ntg.nl
Subject: Re: "Trial typesetting" in ConTeXt / lua ?
Date: Wed, 18 Nov 2015 02:46:00 +0100	[thread overview]
Message-ID: <564BD858.6080809@wxs.nl> (raw)
In-Reply-To: <a9920af9050f4681a75bbe28518a4cdd@gmail.com>

On 11/17/2015 9:15 AM, josephcanedo@gmail.com wrote:
> Hello,
>
> I was wondering if someone could have some hints on this question,
> anyway, I found the function mknodes() from luaTeX wiki and
> nodes.handlers.characters(head) function in ConTeXt (as it seems that
> node.ligaturing(head) and node.kerning(head) do not seem to do anything).
>
> It seems to work fine (ligatures and font features) expect the kerning.
> Does someone know how to perform the kerning as well ?

I'm not sure if i understand your issue.

traditional ligaturing and kerning is applied when a node list has fonts 
using basemode

\starttext

\startluacode

     local hbox = nodes.typesetters.hpack("Hello World!")

     context("%p",hbox.width)

     nodes.flush_list(hbox)

\stopluacode

\stoptext


> Best regards
>
> Joseph Canedo
>
> *From:* josephcanedo@gmail.com <mailto:josephcanedo@gmail.com>
> *Sent:* ‎Saturday‎, ‎November‎ ‎14‎, ‎2015 ‎11‎:‎16‎ ‎AM
> *To:* ntg-context@ntg.nl <mailto:ntg-context@ntg.nl>
>
> Dear all,
>
> Is it possible in ConTeXt within lua code to do “trial typesetting” (not
> sure that’s best name for what I would like to achieve) ? By this I mean
> store some input (with text and macros) in some buffer and do what
> ConTeXt does normally (parsing, create nodes …) but instead of shipping
> the nodes to line breaking algorithm and to the page output, only
> retrieve the nodes and after discard them. This is to get an estimate of
> the total text width within a paragraph (to calculate some shape on the
> paragraph).

you can assemble a list of characters and then do an hpack on them

> I browsed the lua code from http://source.contextgarden.net/
> <http://source.contextgarden.net/tex/context/base/node-ref.lua?search=nodecodes> but
> I do not dare to use too low level lua functionality.
>
> Many thanks for any hint (even a pointer to lua function).
>
> Best regards
>
> Joseph Canedo
>
>
>
>
> ___________________________________________________________________________________
> 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
> ___________________________________________________________________________________
>


-- 

-----------------------------------------------------------------
                                           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
-----------------------------------------------------------------
___________________________________________________________________________________
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:[~2015-11-18  1:46 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-14 10:16 josephcanedo
2015-11-17  8:15 ` josephcanedo
2015-11-17 22:09   ` josephcanedo
2015-11-18  1:46   ` Hans Hagen [this message]
2015-11-18 20:49     ` josephcanedo
2015-11-18 21:22       ` Hans Hagen
2015-11-18 21:36         ` josephcanedo
2015-11-19 16:16           ` josephcanedo
2015-11-19 19:11             ` Hans Hagen
2015-11-19 19:26               ` josephcanedo
2015-11-19 20:36                 ` 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=564BD858.6080809@wxs.nl \
    --to=pragma@wxs.nl \
    --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).