int top = 0; int bot = 0; int height = 0; for (int i = 0; i < box.getChildCount(); i++) { InlineBox inline = (InlineBox) box.getChild(i);  if (inline.floated) { continue;
Font parent_font = FontUtil.getFont(c, style); LineMetrics parent_metrics = null; if (!(content instanceof InlineBlockContent)) { if (!(content instanceof FloatedBlockContent) && !(content instanceof AbsoluteBlockContent)) { parent_metrics = parent_font.getLineMetrics(box.getSubstring(), ((Graphics2D) c.getGraphics()).getFontRenderContext()); } else { parent_metrics = parent_font.getLineMetrics("Test", ((Graphics2D) c.getGraphics()).getFontRenderContext());
    public static void setupVerticalAlign(LineBox box) {        // Uu.p("setting up vertical align for a line: " + box);        // top and bottom are max dist from baseline        int top = 0;        int bot = 0;        int height = 0;        for (int i = 0; i < box.getChildCount(); i++) {            InlineBox inline = (InlineBox) box.getChild(i);            // skip floated inlines. they don't affect height calculations            if (inline.floated) {                continue;            }            if (inline.vset) {                // compare the top of the box                if (inline.y - inline.height < top) {                    top = inline.y - inline.height;                }                // compare the bottom of the box                if (inline.y + 0 > bot) {                    bot = inline.y + 0;                }            } else {                // if it's not one of the baseline derived vertical aligns                // then just compare the straight height of the inline                if (inline.height > height) {                    height = inline.height;                }            }        }        if (bot - top > height) {            box.height = bot - top;            box.baseline = box.height - bot;        } else {            box.height = height;            box.baseline = box.height;        }        // loop through all inlines to set the last ones        for (int i = 0; i < box.getChildCount(); i++) {            InlineBox inline = (InlineBox) box.getChild(i);            if (inline.floated) {                // Uu.p("adjusting floated inline:");                // Uu.p("inline = " + inline);                //inline.y = inline.y;// - box.baseline + inline.height;                // Uu.p("inline = " + inline);            } else {                if (!inline.vset) {                    inline.vset = true;                    if (inline.top_align) {                        inline.y = -box.baseline + inline.height;                    }                    if (inline.bottom_align) {                        inline.y = 0;                    }                }            }        }    }