You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-dev@xmlgraphics.apache.org by Jeremias Maerki <de...@jeremias-maerki.ch> on 2006/07/10 17:10:52 UTC

Error message: "Should be first"

One of my clients reported to me that he gets a "Should be first" error
message on the log. This happens in (Page)BreakingAlgorithm.removeNode().
I get the impression that the code there is not finished rather than
that is a real error condition. I'll try to extend removeNode() so it
really removes the disabled node.

See the attached demo file (You'll need italian hyphenation available to
get the error).

I'll try to fix that tomorrow. If Luca or anyone else has any further comments
on that, I'd appreciate it.

Thanks,
Jeremias Maerki

Re: Error message: "Should be first"

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Argh, sorry guys. I should have thought about that. Attached is the font
metrics file of the "i_helvetica" font (a TrueType fonts).

Here's my font triplet (don't need the actual TrueType font to reproduce
I think):
<font metrics-url="i_helvetica.xml" kerning="yes">
  <font-triplet name="i_helvetica" style="normal" weight="normal"/>
</font>



On 10.07.2006 21:17:46 Simon Pepping wrote:
> On Mon, Jul 10, 2006 at 07:06:23PM +0200, Vincent Hennebert wrote:
> > >One of my clients reported to me that he gets a "Should be first"
> > >error
> > >message on the log. This happens in (Page)BreakingAlgorithm.removeNode().
> > >I get the impression that the code there is not finished rather than
> > >that is a real error condition. I'll try to extend removeNode() so it
> > >really removes the disabled node.
> > >
> > >See the attached demo file (You'll need italian hyphenation available to
> > >get the error).
> > >
> > >I'll try to fix that tomorrow. If Luca or anyone else has any further 
> > >comments
> > >on that, I'd appreciate it.
> > 
> > I don't have any error with this file. However, I've had to change the
> > font names because i_helvetica is unknown. I've tried with Helvetica and
> > Helvetica + font-style="italic" (as I suppose is what the "i_" means)
> > but I still don't get any error. How did you get it?
> > 
> > Regarding the "should be first" error, that's a part of the algorithm
> > I don't completely understand, yet. That said, the removeNode method is
> > called, among other places, in filterActiveNodes. This is only a guess,
> > but if there is a place where the removeNode's "precondition" isn't
> > respected, that might be here.
> 
> I could not reproduce the problem either. When looking at the code, it
> is not clear to me why one would expect the removed node to be the
> first in the list. I am surprised that this error does not occur more
> often. I must be overlooking something.


Jeremias Maerki

Re: Error message: "Should be first"

Posted by Simon Pepping <sp...@leverkruid.eu>.
On Mon, Jul 10, 2006 at 07:06:23PM +0200, Vincent Hennebert wrote:
> >One of my clients reported to me that he gets a "Should be first"
> >error
> >message on the log. This happens in (Page)BreakingAlgorithm.removeNode().
> >I get the impression that the code there is not finished rather than
> >that is a real error condition. I'll try to extend removeNode() so it
> >really removes the disabled node.
> >
> >See the attached demo file (You'll need italian hyphenation available to
> >get the error).
> >
> >I'll try to fix that tomorrow. If Luca or anyone else has any further 
> >comments
> >on that, I'd appreciate it.
> 
> I don't have any error with this file. However, I've had to change the
> font names because i_helvetica is unknown. I've tried with Helvetica and
> Helvetica + font-style="italic" (as I suppose is what the "i_" means)
> but I still don't get any error. How did you get it?
> 
> Regarding the "should be first" error, that's a part of the algorithm
> I don't completely understand, yet. That said, the removeNode method is
> called, among other places, in filterActiveNodes. This is only a guess,
> but if there is a place where the removeNode's "precondition" isn't
> respected, that might be here.

I could not reproduce the problem either. When looking at the code, it
is not clear to me why one would expect the removed node to be the
first in the list. I am surprised that this error does not occur more
often. I must be overlooking something.

Simon 

-- 
Simon Pepping
home page: http://www.leverkruid.eu

Re: Error message: "Should be first"

Posted by Vincent Hennebert <vi...@enseeiht.fr>.
> One of my clients reported to me that he gets a "Should be first"
> error
> message on the log. This happens in (Page)BreakingAlgorithm.removeNode().
> I get the impression that the code there is not finished rather than
> that is a real error condition. I'll try to extend removeNode() so it
> really removes the disabled node.
>
> See the attached demo file (You'll need italian hyphenation available to
> get the error).
>
> I'll try to fix that tomorrow. If Luca or anyone else has any further comments
> on that, I'd appreciate it.

I don't have any error with this file. However, I've had to change the
font names because i_helvetica is unknown. I've tried with Helvetica and
Helvetica + font-style="italic" (as I suppose is what the "i_" means)
but I still don't get any error. How did you get it?

Regarding the "should be first" error, that's a part of the algorithm
I don't completely understand, yet. That said, the removeNode method is
called, among other places, in filterActiveNodes. This is only a guess,
but if there is a place where the removeNode's "precondition" isn't
respected, that might be here.

HTH,
Vincent

Re: Error message: "Should be first"

Posted by Jeremias Maerki <de...@jeremias-maerki.ch>.
Thanks everyone. I know now which way to go.

On 11.07.2006 20:14:59 Finn Bock wrote:
> Jeremias Maerki wrote:
> 
> > One of my clients reported to me that he gets a "Should be first" error
> > message on the log. This happens in (Page)BreakingAlgorithm.removeNode().
> > I get the impression that the code there is not finished rather than
> > that is a real error condition.
> 
> Correct. In BreakingAlgorithm, at least, I simply didn't bother to 
> implement the out-of-order removing because I thought it wouldn't happen.
> 
> Adding conditions and flags, such as found in PageBreakingAlgorithm 
> seems unnecessary to me.
> 
> Just unconditionally remove the node in the single-linked list.
> 
> regards,
> finn



Jeremias Maerki


Re: Error message: "Should be first"

Posted by Finn Bock <bc...@worldonline.dk>.
Jeremias Maerki wrote:

> One of my clients reported to me that he gets a "Should be first" error
> message on the log. This happens in (Page)BreakingAlgorithm.removeNode().
> I get the impression that the code there is not finished rather than
> that is a real error condition.

Correct. In BreakingAlgorithm, at least, I simply didn't bother to 
implement the out-of-order removing because I thought it wouldn't happen.

Adding conditions and flags, such as found in PageBreakingAlgorithm 
seems unnecessary to me.

Just unconditionally remove the node in the single-linked list.

regards,
finn