private CharCounts countJustifiableChars() { CharCounts result = new CharCounts(); for (Iterator i = getChildIterator(); i.hasNext(); ) { Box b = (Box)i.next(); if (b instanceof InlineLayoutBox) { ((InlineLayoutBox)b).countJustifiableChars(result); } } return result; }
public void countJustifiableChars(CharCounts counts) { String s = getSubstring(); int len = s.length(); int spaces = 0; int other = 0; for (int i = 0; i < len; i++) { char c = s.charAt(i); if (c == ' ' || c == '\u00a0' || c == '\u3000') { spaces++; } else { other++; } } counts.setSpaceCount(counts.getSpaceCount() + spaces); counts.setNonSpaceCount(counts.getNonSpaceCount() + other); }
if (! getParent().getStyle().isIdent(CSSName.LETTER_SPACING, IdentValue.NORMAL)) { info.setNonSpaceAdjust(0.0f); info.setSpaceAdjust((float)toAdd / counts.getSpaceCount()); } else { if (counts.getNonSpaceCount() > 1) { info.setNonSpaceAdjust((float)toAdd * JUSTIFY_NON_SPACE_SHARE / (counts.getNonSpaceCount()-1)); } else { info.setNonSpaceAdjust(0.0f); if (counts.getSpaceCount() > 0) { info.setSpaceAdjust((float)toAdd * JUSTIFY_SPACE_SHARE / counts.getSpaceCount()); } else { info.setSpaceAdjust(0.0f);
if (! getParent().getStyle().isIdent(CSSName.LETTER_SPACING, IdentValue.NORMAL)) { info.setNonSpaceAdjust(0.0f); info.setSpaceAdjust((float)toAdd / counts.getSpaceCount()); } else { if (counts.getNonSpaceCount() > 1) { info.setNonSpaceAdjust((float)toAdd * JUSTIFY_NON_SPACE_SHARE / (counts.getNonSpaceCount()-1)); } else { info.setNonSpaceAdjust(0.0f); if (counts.getSpaceCount() > 0) { info.setSpaceAdjust((float)toAdd * JUSTIFY_SPACE_SHARE / counts.getSpaceCount()); } else { info.setSpaceAdjust(0.0f);
public void countJustifiableChars(CharCounts counts) { String s = getSubstring(); int len = s.length(); int spaces = 0; int other = 0; for (int i = 0; i < len; i++) { char c = s.charAt(i); if (c == ' ' || c == '\u00a0' || c == '\u3000') { spaces++; } else { other++; } } counts.setSpaceCount(counts.getSpaceCount() + spaces); counts.setNonSpaceCount(counts.getNonSpaceCount() + other); }
private CharCounts countJustifiableChars() { CharCounts result = new CharCounts(); for (Iterator i = getChildIterator(); i.hasNext(); ) { Box b = (Box)i.next(); if (b instanceof InlineLayoutBox) { ((InlineLayoutBox)b).countJustifiableChars(result); } } return result; }