ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen via ntg-context <ntg-context@ntg.nl>
To: ntg-context@ntg.nl
Cc: Hans Hagen <j.hagen@xs4all.nl>
Subject: Re: Count (and limit) glyphs per line?
Date: Sun, 26 Jun 2022 19:11:00 +0200	[thread overview]
Message-ID: <398aba32-30a9-412b-5a1b-25067b626d69@xs4all.nl> (raw)
In-Reply-To: <436F4218-E4EC-4107-861B-B60385707E65@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2233 bytes --]

On 6/25/2022 10:25 PM, Benjamin Buchmuller via ntg-context wrote:
> Dear list,
> 
> A brief follow-up for (1) itemizations [resolved; but question on ConTeXt hsize defaults] and (2) hyphenation [troubles].
> 
> (1) To deal with itemizations and other situation where texts are indented such as:
> 
>     \setuppapersize[landscape,letter]
>     \showframe
>     \starttext
> 	   \samplefile{knuth}
> 	   \ctxlua{context(tex.dimen["textwidth"])} % 37213340
> 	   \ctxlua{context(tex.dimen["localhsize"])} % 0
> 	   \startitemize[width=5em]
> 	   \item \samplefile{knuth}
> 	   \ctxlua{context(tex.dimen["textwidth"])} % 37213340
> 	   \ctxlua{context(tex.dimen["localhsize"])} % 33283340
> 	   \stopitemize
>     \stoptext

The problem with these thing is that there is more involved than just 
counting, like font features, hyphenation, current paragrph properties, 
etc. and you don't want interference with other features. You also want 
the paragraphs to look somewhat ok. Folks who enforce such demands on 
authors never wonder where the tools do do that come from (publishers 
and probably most designers are not interested in that anyway: thinking 
probably stops at the number '120').

Attached a proof of concept that gives an idea. No upload as first we 
need to do some wrapping up of math. Not that we needed something in the 
engine other than the linebreak helper to accept direct modes (no need 
to go back and forth then and i only want write this crap once). Could 
be a module although it's only some 70 lines of code in the end. Maybe 
it makes a nice (lmtx) demo for the ctx meeting too.

Here we work per paragraph not per line which looks better on the 
average. One could mess with parshapes but why bother.

(The todo in the name refers to the fact that it might do into a th elow 
level paragraph manual.)

(No more time now but we can add later; remind me if I forget.)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
        tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
-----------------------------------------------------------------

[-- Attachment #2: todo-paragraphs.pdf --]
[-- Type: application/pdf, Size: 49150 bytes --]

[-- Attachment #3: Type: text/plain, Size: 493 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

  parent reply	other threads:[~2022-06-26 17:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24  3:15 Benjamin Buchmuller via ntg-context
2022-06-24  5:44 ` Max Chernoff via ntg-context
2022-06-25 15:38   ` Benjamin Buchmuller via ntg-context
2022-06-25 20:25     ` Benjamin Buchmuller via ntg-context
2022-06-25 21:40       ` Max Chernoff via ntg-context
2022-06-26 15:59         ` Benjamin Buchmuller via ntg-context
2022-06-26 22:32           ` Max Chernoff via ntg-context
2022-06-27  9:33             ` Hans Hagen via ntg-context
2022-07-18 21:24             ` Benjamin Buchmuller via ntg-context
2022-07-26 17:40               ` Hans Hagen via ntg-context
2022-06-26 17:11       ` Hans Hagen via ntg-context [this message]
2022-06-26  8:28     ` Hans Hagen via ntg-context
2022-06-24  7:31 ` Henning Hraban Ramm via ntg-context
2022-06-24 17:58 ` Hans Hagen via ntg-context
2022-06-26 19:26 Benjamin Buchmuller via ntg-context

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=398aba32-30a9-412b-5a1b-25067b626d69@xs4all.nl \
    --to=ntg-context@ntg.nl \
    --cc=j.hagen@xs4all.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).