def unaligned_get_dimension(text):
    """Return the bounding box of the text, assuming that the left-bottom corner
    of the first letter of the text is at (0, 0). This procedure ignores
    /h, /v, and /a directives when calculating the BB; it just returns the
    alignment specifiers as a part of the return value. The return value is a
    tuple (width, height, halign, valign, angle)."""

    xmax = 0
    ymax = 0
    ymax = 0
    angle = None
    halign = None
    valign = None
    itr = text_iterator(None)
    for line in str(text).split('\n'):
        cur_height = 0
        cur_width = 0
        itr.reset(line)
        while 1:
            elem = next(itr)
            if not elem:
                break
            (font, size, line_height, color, new_h, new_v, new_a, chunk) = elem
            if halign != None and new_h != halign:
                raise FontException('Only one "/h" can appear in a string.',
                                    str(text))
            if valign != None and new_v != valign:
                raise FontException('Only one "/v" can appear in a string.',
                                    str(text))
            if angle != None and new_a != angle:
                raise FontException('Only one "/a" can appear in a string.',
                                    str(text))
            halign = new_h
            valign = new_v
            angle = new_a
            cur_width += line_width(font, size, chunk)
            cur_height = max(cur_height, line_height)
        xmax = max(cur_width, xmax)
        ymax += cur_height
    return (xmax, ymax,
            halign or theme.default_font_halign,
            valign or theme.default_font_valign,
            angle or theme.default_font_angle)