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); }
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) { 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) { if (counts.getSpaceCount() > 0) { info.setSpaceAdjust((float)toAdd * JUSTIFY_SPACE_SHARE / counts.getSpaceCount()); } else { info.setSpaceAdjust(0.0f);