ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Cc: NTG-ConTeXt mailing list <ntg-context@ntg.nl>
Subject: Re: river detection
Date: Thu, 11 Jan 2001 08:56:53 +0100	[thread overview]
Message-ID: <3.0.6.32.20010111085653.0199a100@server-1> (raw)
In-Reply-To: <m3puhv8c8c.fsf@coe.uga.edu>

At 01:59 PM 1/10/01 -0500, Ed L Cashin wrote:
>Hans Hagen <pragma@wxs.nl> writes:
>
>> At 11:58 AM 1/10/01 -0500, Ed L Cashin wrote:
>> 
>> >But you could just do a TeX macro that expands to a kind of matrix
>> >like this:
>> >
>> >           (5, 6) (11, 15) (35, 40)
>> >           (7, 9) (11, 15) (26, 30)
>> >           (2, 4) (11, 14) (24, 26)
>> >
>> >(there's a river at position eleven).
>> 
>> Eh ... when tex typesets a paragraph, all input is already converted to
>> lists and macro expansion is gone. So, bbox info should come from the list
>> to dvi pass [or maybe from within the paragraph builder]. Keep in mind that
>> f i e t s [bicycle] is not just 5 chars, but becomes fi e t s and that at
>> some point the hyphenation engine pops in too. No way to hyphenate
>> \hbox{f}\hbox{i}...\hbox{s}.
>
>I don't know what you mean by "the list to dvi pass".
>
>Within the paragraph builder, though, I'm thinking that there's a time
>when TeX tries a certain paragraph configuration.  At that time, you
>have information about where the horizontal glue between hboxes begins
>and ends.  That's the information that I was talking about in my
>example.  With "I   w u v   fi e t s", TeX knows that there's a good
>bit of horizontal glue after the "v" box and before the "fi" box.  It
>knows the leftmost and rightmost position of that glue, right?
>
>I was thinking that the river badness can be calculated at that time,
>but are you saying that it can't be calculated at that time by a macro
>because all the macro expansion is not going on at that time?

Right. Input (either or not expanded macros) is converted into a linked
list. This list is then broken into lines [actually a solution tree first].
Normally baddness is calculated by summarizing badness's of lines [kind
of]. A river detector should act upon the *resulting* paragraph as a whole,
since it should look 'vertical' instead of horizontal. 

I think that some heuristic method is needed then. I can even think of
wierd ones, like: 

build a bitmap from the boundingboxes of the chars [no interlinespace],
enlarge the bitmaps some 10%, then compress the bitmap. The smaller it is,
the better the grayness [guess]. Or apply jpeg/mpeg like analysis, with
those neighbouring pixel analyzation things.  

River detection could be done by tracing edges or something like that or a
neural net. 

Of course one could act upon the list directlty, but i think that a more
visual related method is easier, especially since we also need to take the
actual dimensions of the bbox into account [even better: the real shape or
composed shape]. 

Hans
-------------------------------------------------------------------------
                                  Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                      Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
 tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------


  reply	other threads:[~2001-01-11  7:56 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-09 18:45 Ed L Cashin
2001-01-10  8:27 ` Hans Hagen
2001-01-10 16:58   ` Ed L Cashin
2001-01-10 17:38     ` Hans Hagen
2001-01-10 18:59       ` Ed L Cashin
2001-01-11  7:56         ` Hans Hagen [this message]
2001-01-11 20:21           ` Ed L Cashin
2001-01-12 14:57   ` H. Ramm
2001-01-10 10:40 ` Frans Goddijn
2001-01-10 11:29   ` Dan Seracu
2001-01-10 11:58     ` Hans Hagen
2001-01-10 11:57   ` Hans Hagen
2001-01-10 13:14     ` Taco Hoekwater
2001-01-10 14:04       ` Hans Hagen
2001-01-10 21:07   ` H. Ramm
     [not found] <Hans Hagen's message of "Wed, 10 Jan 2001 18:38:13 +0100">

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=3.0.6.32.20010111085653.0199a100@server-1 \
    --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).