On Sun, 18 Dec 2005 03:30 am, Simon Pepping wrote:
> On Sat, Dec 17, 2005 at 05:46:42PM +0100, Andreas L Delmelle wrote:
> > On Dec 17, 2005, at 16:29, Manuel Mall wrote:
> >
> >
> > Hi,
> >
> > >On Sat, 17 Dec 2005 11:07 pm, Simon Pepping wrote:
> > >>On Sat, Dec 17, 2005 at 11:43:36AM +0800, Manuel Mall wrote:
> > >
> > ><snip/>
> > >
> > >>The case is contradictory in itself, and quite unique. A nbsp
> > >> will never occur at the end of a line by its very definition,
> > >> except in this case!
> > >
> > >Simon,
> > >
> > >I don't quite get it what you are trying to say.
> > >
> > ><fo:block>&#160;</fo:block>
> > >
> > >is perfectly legal and sensible in both XSL-FO (and HTML) and
> > > doesn't that mean a nbsp does occur at the end (and beginning) of
> > > a line.
> >
> > I guess what Simon is referring to is that if the line-breaking
> > algorithm does its job adequately, there will be no line-break
> > preceding/following a non-breaking-space, except when it is the
> > first/ last character in a block. Other break-possibilities should,
> > in theory at least, always be considered more favorable than
> > breaking before/after the nbsp... Correct, Simon?
>
> That is precisely what I tried to say.
>
> > >What is contradictory or unique about this?
> >
> > That indeed is a bit overstating the case. It's not contradictory,
> > but it is a rather special situation. Not taking into account the
> > number of times such a construct is used in practice... It is more
> > of an HTML/XSL-FO trick to make a block appear non-empty --used
> > mainly in the context of table-cells, to have their borders drawn
> > despite the fact that there is no visible content.
>
> It is not a formal contradiction, but it feels like one: nbsp should
> not have a linebreak around it, but here we have to solve the problem
> how to deal with it when it does have a linebreak preceding or
> following it.
>
Simon,

sorry Simon (and thanks Andreas) I was a bit slow in understanding what 
you were saying. While I still don't quite agree with the statement 
'nbsp should not have a linebreak around it' because nbsp surrounded by 
whitespace (and therefore surrounded by possible linebreaks) for 
example is perfectly legal and sensible in some situations this really 
is not important here.

Does it mean because the Knuth algorithm removes all glues after a 
linebreak (and we also remove all glues at the end of a paragraph) a 
nbsp should not be modelled not like this:

   pen p=INF
   glue w=...

but like this:

   box w=0 aux=true
   pen p=INF
   glue w=...
   box w=0 aux=true

with the leading box preventing removal at the beginning of a line, the 
trailing box prevents removal at the end of a paragraph, and the 
penalty prevents a line break.

> Simon

Manuel

Reply via email to