LineMetrics blockLineMetrics = curr_line.blockLineMetrics;
return getBaselineOffset(style, c, tr, g2, ascent, descent, lineHeight, leading, curr_line, bfc);
    public static int getBaselineOffset(CssContext c, LineBox curr_line, InlineBox new_inline, TextRenderer tr, Graphics2D g2, BlockFormattingContext bfc) {        int lineHeight;        int ascent;        int descent;        int leading;        //int xheight;        int baselineOffset;        if (new_inline instanceof InlineTextBox) {            // should be the metrics of the font, actually is the metrics of the text            LineMetrics metrics = FontUtil.getLineMetrics(new_inline.getStyle().getFont(c), new_inline, tr, g2);            lineHeight = (int) Math.round(new_inline.getStyle().getCalculatedStyle().getLineHeight(c));            ascent = (int) metrics.getAscent();            descent = (int) metrics.getDescent();            leading = (int) metrics.getLeading();            //xheight = (int)(-metrics.getStrikethroughOffset()*2.0);        } else {            lineHeight = new_inline.height;            ascent = lineHeight;            descent = 0;            leading = 0;            //xheight = lineHeight/2;        }        LineMetrics blockLineMetrics = curr_line.blockLineMetrics;        //Assumption: our baseline is aligned with parent baseline        IdentValue vertical_align = new_inline.getStyle().getCalculatedStyle().getIdent(CSSName.VERTICAL_ALIGN);        if (vertical_align == IdentValue.BASELINE) {            baselineOffset = 0;        } else if (vertical_align == IdentValue.SUPER) {            // works okay i think            baselineOffset = (int) Math.round(-blockLineMetrics.getStrikethroughOffset() * 1.5);//up is negative in Java!            //XRLog.render("baseline offset for super "+baselineOffset);        } else if (vertical_align == IdentValue.SUB) {            // works okay i think            baselineOffset = (int) blockLineMetrics.getStrikethroughOffset();//up is negative in Java!            //XRLog.render("baseline offset for sub "+baselineOffset);        } else if (vertical_align == IdentValue.TEXT_TOP) {            // the top of this text is equal to the top of the parent's text            // so we take the parent's height above the baseline and subtract our            // height above the baseline            baselineOffset = (int) (blockLineMetrics.getAscent() - ascent);            //XRLog.render("baseline offset for text-top"+baselineOffset);        } else if (vertical_align == IdentValue.TEXT_BOTTOM) {            baselineOffset = -(int) (blockLineMetrics.getDescent() - descent);            //XRLog.render("baseline offset for text-bottom"+baselineOffset);        } else if (vertical_align == IdentValue.MIDDLE) {            // just like firefox!            int halfxheight = -(int) (blockLineMetrics.getStrikethroughOffset());            int boxmiddle = (int) Math.round(new_inline.height / 2.0);            int boxbase = (int) Math.round(ascent + leading / 2.0);            int boxalign = boxbase - boxmiddle;            baselineOffset = halfxheight - boxalign;        } else if (vertical_align == IdentValue.TOP) {            // like firefox, so I suppose it's correct...            baselineOffset = curr_line.getBaseline() - lineHeight;        } else if (vertical_align == IdentValue.BOTTOM) {            baselineOffset = descent - (curr_line.height - curr_line.getBaseline());        } else {            baselineOffset = (int) new_inline.getStyle().getCalculatedStyle().getFloatPropertyProportionalHeight(CSSName.VERTICAL_ALIGN, bfc.getHeight(), c);        }        return baselineOffset;    }