private static InlineLayoutBox addFirstLetterBox(LayoutContext c, LineBox current, InlineLayoutBox currentIB, LineBreakContext lbContext, int maxAvailableWidth, int remainingWidth) { CalculatedStyle previous = currentIB.getStyle(); currentIB.setStyle(c.getFirstLettersTracker().deriveAll(currentIB.getStyle())); InlineLayoutBox iB = new InlineLayoutBox(c, null, currentIB.getStyle(), maxAvailableWidth); iB.setStartsHere(true); iB.setEndsHere(true); currentIB.addInlineChild(c, iB); current.setContainsContent(true); InlineText text = layoutText(c, iB.getStyle(), remainingWidth, lbContext, true); iB.addInlineChild(c, text); iB.setInlineWidth(text.getWidth()); lbContext.setStart(lbContext.getEnd()); c.getFirstLettersTracker().clearStyles(); currentIB.setStyle(previous); return iB; }
private static InlineLayoutBox addFirstLetterBox(LayoutContext c, LineBox current, InlineLayoutBox currentIB, LineBreakContext lbContext, int maxAvailableWidth, int remainingWidth) { CalculatedStyle previous = currentIB.getStyle(); currentIB.setStyle(c.getFirstLettersTracker().deriveAll(currentIB.getStyle())); InlineLayoutBox iB = new InlineLayoutBox(c, null, currentIB.getStyle(), maxAvailableWidth); iB.setStartsHere(true); iB.setEndsHere(true); currentIB.addInlineChild(c, iB); current.setContainsContent(true); InlineText text = layoutText(c, iB.getStyle(), remainingWidth, lbContext, true); iB.addInlineChild(c, text); iB.setInlineWidth(text.getWidth()); lbContext.setStart(lbContext.getEnd()); c.getFirstLettersTracker().clearStyles(); currentIB.setStyle(previous); return iB; }
protected void layoutChildren(LayoutContext c, int contentStart) { setState(Box.CHILDREN_FLUX); ensureChildren(c); if (getFirstLetterStyle() != null) { c.getFirstLettersTracker().addStyle(getFirstLetterStyle()); } if (getFirstLineStyle() != null) { c.getFirstLinesTracker().addStyle(getFirstLineStyle()); } switch (getChildrenContentType()) { case CONTENT_INLINE: layoutInlineChildren(c, contentStart, calcInitialBreakAtLine(c), true); break; case CONTENT_BLOCK: BlockBoxing.layoutContent(c, this, contentStart); break; } if (getFirstLetterStyle() != null) { c.getFirstLettersTracker().removeLast(); } if (getFirstLineStyle() != null) { c.getFirstLinesTracker().removeLast(); } setState(Box.DONE); }
protected void layoutChildren(LayoutContext c, int contentStart) { setState(Box.CHILDREN_FLUX); ensureChildren(c); if (getFirstLetterStyle() != null) { c.getFirstLettersTracker().addStyle(getFirstLetterStyle()); } if (getFirstLineStyle() != null) { c.getFirstLinesTracker().addStyle(getFirstLineStyle()); } switch (getChildrenContentType()) { case CONTENT_INLINE: layoutInlineChildren(c, contentStart, calcInitialBreakAtLine(c), true); break; case CONTENT_BLOCK: BlockBoxing.layoutContent(c, this, contentStart); break; } if (getFirstLetterStyle() != null) { c.getFirstLettersTracker().removeLast(); } if (getFirstLineStyle() != null) { c.getFirstLinesTracker().removeLast(); } setState(Box.DONE); }
boolean needFirstLetter = c.getFirstLettersTracker().hasStyles(); boolean zeroWidthInlineBlock = false;
boolean needFirstLetter = c.getFirstLettersTracker().hasStyles(); boolean zeroWidthInlineBlock = false;