lout-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: rragged paragraph breaking style


From: Ludovic Courtès
Subject: Re: rragged paragraph breaking style
Date: Thu, 20 Apr 2006 18:14:55 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/21.4 (gnu/linux)

Hi,

"Patrick D." <address@hidden> writes:

> I get the impression that the `rragged' paragraph
> breaking style may be broken. In the example given
> below, I do not see why several paragraphs are left
> aligned, e.g. `one', `a', `9', `a_b', `!' . 

I remember hitting this problem some time ago, but I can't remember how
I solved it.

Anyway, after some debugging (gory details included below for patch
review), I got to a simple fix (see below).  Let me know if it works for
you (should apply fine on 3.31 and 3.30) and does not introduce new
problems.

Thanks,
Ludovic.


--- orig/z08.c
+++ mod/z08.c
@@ -1018,7 +1018,7 @@
     case WORD:
     case QWORD:
     
-      if( !ok || *crs == nilobj )
+      if( !ok )
       {        word_font(x) = font(*style);
        word_colour(x) = colour(*style);
        word_texture(x) = texture(*style);





[Skippable debugging story starts here.]

If you run Lout with `-dddsf' (in order to see the message at
z23.c:1172, which is the only place where the `rragged' display is taken
care of --- grep for `DISPLAY_RIGHT'), then you get this:

  sf: rdisp [[ ["alpha"] &0.1ce ["beta"] ]]
  sf: rdisp [[ ["a9"] ]]
  sf: rdisp [[ ["a,"] ]]
  sf: rdisp [[ ["1984"] ]]
  sf: rdisp [[ ["-9"] ]]
  sf: rdisp [[ ["9.2"] ]]
  sf: rdisp [[ ["a"] &0.1ce ["b"] ]]
  sf: rdisp [[ ["9"] &0.1ce ["8"] ]]
  sf: rdisp [[ ["9_8"] ]]
  sf: rdisp [[ ["9_"] ]]
  sf: rdisp [[ ["-a"] ]]
  sf: rdisp [[ ["a_b"] &0.1ce ["c"] ]]
  sf: rdisp [[ ["a_9"] ]]
  sf: rdisp [[ ["-a_b"] ]]
  sf: rdisp [[ ["a-b"] ]]
  sf: rdisp [[ ["a!"] ]]
  sf: rdisp [[ ["!_"] ]]
  sf: rdisp [[ ["_!"] ]]
  sf: rdisp [[ ["Thanks."] ]]

All the words shown here are those that properly display as
right-justified.  The others (e.g., "one") don't show up here.  IOW, it
looks as if style information had been lost for some words.

If you add `-dddom' to get early information about objects, and then
grep for

  ^om:.*returning.*"(a9|one)"

(because the word "a9" is properly right-justified while "one" is not),
you will notice these differences:

  om: [ ManifestCat({} //@address@hidden [[ ["alpha"] &0.0ceu ["beta"] ]] 
//@address@hidden "one" //@address@hidden [[ ["a"] &0.0ceu ["9"] ]] 
//@address@hidden "a" //@address@hidden [[ ["a"] &0.0ceu [","] ]] 
//@address@hidden "9" //@address@hidden ... <too long>)
  ...
  om:   manfifest/WORD underline() := UNDER_OFF for word "one"
  om: ]Manifest returning word "one"
  ...
  om: ]Manifest returning acat [[ ["a9"] ]]

Now, the issue is that our word "one" gets treated an a "non-real" word
in the block starting at z08.c:1022.  Thus, it does not get inserted
into a paragraph (an `ACAT' object) with appropriate style information
copied (including display type).

I believe the `if' condition there is too large, hence the patch.  It
fixes the problem and doesn't *seem* to introduce new ones.  Jeff, can
you review this?


reply via email to

[Prev in Thread] Current Thread [Next in Thread]