InlineBox prev, InlineBox prev_align, boolean isFirstLetter, CascadedStyle firstLetterStyle, CascadedStyle firstLineStyle) {
InlineBox prev, InlineBox prev_align, boolean isFirstLetter, CascadedStyle firstLetterStyle, boolean isFirstLine, CascadedStyle firstLineStyle) {
    private InlineBox calculateInline(Context c, Content content, int avail, int max_width,                                      InlineBox prev, InlineBox prev_align, boolean isFirstLetter, CascadedStyle firstLetterStyle, CascadedStyle firstLineStyle) {        CalculatedStyle style = content.getStyle();        // get the current font. required for sizing        Font font = FontUtil.getFont(c, style);        // handle each case        if (content instanceof InlineBlockContent) {            //u.p("is replaced");            return LineBreaker.generateReplacedInlineBox(c, content, avail, prev_align, font);        }        //u.p("calc inline on node : " + node);        if (content instanceof FloatedBlockContent) {            //u.p("calcinline: is floated block");            return FloatUtil.generateFloatedBlockInlineBox(c, content, avail, prev_align, font);        }        //OK, now we should have only TextContent left, fail fast if not        TextContent textContent = (TextContent) content;        // calculate the starting index        int start = 0;        // if this is another box from the same node as the previous one        if (prev != null && prev.getContent() == textContent) {            start = prev.end_index;        }        // get the text of the node        String text = textContent.getText();        // transform the text if required (like converting to caps)        // this must be done before any measuring since it might change the        // size of the text        //u.p("text from the node = \"" + text + "\"");        text = TextUtil.transformText(text, style);        // u.p("calculating inline: text = " + text);        // u.p("avail space = " + avail + " max = " + max_width + "   start index = " + start);        if (isFirstLetter && firstLetterStyle != null) {            //u.p("is first letter");            return LineBreaker.generateFirstLetterInlineBox(c, start, text, prev_align, textContent, firstLetterStyle, firstLineStyle);        }        /*if (c.getRenderingContext().getLayoutFactory().isBreak(node)) {//not needed, handled by before-content            // u.p("is break");            return LineBreaker.generateBreakInlineBox(node);        }*/                // new whitespace code        // u.p("calling whitespace stripper on node: " + node);        // u.p(" prev = " + prev);        return WhitespaceStripper.createInline(c, textContent, prev, prev_align, avail, max_width, font, firstLineStyle);    }