How do I find a bounding box for text with corrupt type3 font?

Q: I am trying to get the bounding box for Text element, but I
encountered one PDF where bool pdftron::PDF::Element::GetBBox ( Rect
& out_bbox ) returns false.

The same code works fine for other PDFs. Is there any other way to get
the bounding box when GetBBox fails?
A: The problem is that the file is using a Type3 font which has
corrupt font bounding box [0, 0, 0, 0]. You could open Type3 font
display list and find the bounding box for all element in the glyph
stream using Type3FontBegin.

Perhaps something along the following lines:

CharIterator itr = text_element.GetCharIterator();
if (font.GetType() == Font.Type.e_Type3) {
for (; itr.HasNext(); itr.Next()) {
    Obj font_stm = font.GetType3GlyphStream(itr.Current().char_code);
    Matrix2D pos(1, 0, 0, 1, itr.Current().x, itr.Current().y);
    element_reader.Type3FontBegin(font_stm, font.GetSDFObj(), 0);
    ProcessElements(mtx * pos * font_mtx); << Here find the bbox for
all elements (this is the bbox for the glyph).

Q: Since we already have an Element and we are iterating for all the
characters in an element, I am not sure what the ProcessElements()
will do? Can you please clarify?
A: ProcessElements() is a simple recursive function that enumerates a
display list (for example please see ElementReader or ElementReaderAdv
sample project). In this case you are opening a child display list
used to represent a single Type3 glyph. Typically you will fing a
bitmap image representing a glyph, but you may also encounter any
outer PDF element (e.g. path, text, etc).