#747181 poppler: many incorrect messages "Syntax Warning: Bad bounding box in Type 3 glyph"

#747181#5
Date:
2014-05-06 08:39:58 UTC
From:
To:
On some PDF files, xpdf outputs many warning messages, such as:

  Syntax Warning: Bad bounding box in Type 3 glyph

These warnings can fill up the terminal, distract the user, and make
xpdf slow (I have an example where there are more that 1000 warnings
per page). At most one warning per page should be output, possibly
with the number of times it occurred.

#747181#10
Date:
2018-08-30 23:10:52 UTC
From:
To:
Hi,

Yes, xpdf shows many warnings, and adding "-q" command line option
should make xpdf silent. Could you try it out?  Thanks!

#747181#15
Date:
2021-09-17 12:40:06 UTC
From:
To:
Hi,

The -q option silences the warnings, but it is described as

  Don't print any messages or errors.

i.e. it will also silence the errors, which is not acceptable.

Moreover, there shouldn't be a need to silence anything, as
the PDF file (generated by ps2pdf) appears to be correct;
in particular, atril and xournal don't complain.

The warning comes from xpdf/SplashOutputDev.cc

  if (xMin - xt < t3Font->glyphX ||
      yMin - yt < t3Font->glyphY ||
      xMax - xt > t3Font->glyphX + t3Font->glyphW ||
      yMax - yt > t3Font->glyphY + t3Font->glyphH) {
    if (t3Font->validBBox) {
      error(errSyntaxWarning, -1, "Bad bounding box in Type 3 glyph");
    }
    return;
  }

Note that the values are double's, so that the comparisons may be
subject to floating-point rounding errors. I don't know whether
this is the reason here (I could try to look at this more closely),
but I suppose that this code could issue warnings only because of
that.

If this warning comes from a bug in xpdf, such a bug should be fixed.

#747181#26
Date:
2021-09-17 13:30:50 UTC
From:
To:
Actually it doesn't (commenting out this line doesn't change
anything). Perhaps a bug in poppler, then, as it has similar
code in poppler/SplashOutputDev.cc:

    if (xMin - xt < t3Font->glyphX || yMin - yt < t3Font->glyphY || xMax - xt > t3Font->glyphX + t3Font->glyphW || yMax - yt > t3Font->glyphY + t3Font->glyphH) {
        if (t3Font->validBBox) {
            error(errSyntaxWarning, -1, "Bad bounding box in Type 3 glyph");
        }
        return;
    }

#747181#31
Date:
2021-09-18 01:14:03 UTC
From:
To:
Thanks for the check.  It sounds more poppler side.  I just read this
email, but are you OK to reassign it to poppler?
Also it might be better to annotate a prefix like "poppler" in the error in
general - though it's a bit of a large change...

2021年9月17日(金) 22:30 Vincent Lefevre <vincent@vinc17.net>:

#747181#36
Date:
2021-09-18 01:48:49 UTC
From:
To:
Control: reassign -1 libpoppler102 20.09.0-3.1
Control: retitle -1 poppler: many incorrect messages "Syntax Warning: Bad bounding box in Type 3 glyph"
Control: affects -1 xpdf

Doing it now.

Yes, but if this can be done in the error() function, that would
be quite a small change.