public float calcTotalAdjustment(JustificationInfo info) { String s = getSubstring(); int len = s.length(); float result = 0.0f; for (int i = 0; i < len; i++) { char c = s.charAt(i); if (c == ' ' || c == '\u00a0' || c == '\u3000') { result += info.getSpaceAdjust(); } else { result += info.getNonSpaceAdjust(); } } return result; } public int getStart(){
JustificationInfo info = new JustificationInfo(); 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); info.setSpaceAdjust((float)toAdd * JUSTIFY_SPACE_SHARE / counts.getSpaceCount()); } else { info.setSpaceAdjust(0.0f);
JustificationInfo info = new JustificationInfo(); 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); info.setSpaceAdjust((float)toAdd * JUSTIFY_SPACE_SHARE / counts.getSpaceCount()); } else { info.setSpaceAdjust(0.0f);
public float calcTotalAdjustment(JustificationInfo info) { String s = getSubstring(); int len = s.length(); float result = 0.0f; for (int i = 0; i < len; i++) { char c = s.charAt(i); if (c == ' ' || c == '\u00a0' || c == '\u3000') { result += info.getSpaceAdjust(); } else { result += info.getNonSpaceAdjust(); } } return result; } public int getStart(){
private void adjustGlyphPositions( String string, JustificationInfo info, GlyphVector vector) { float adjust = 0.0f; for (int i = 0; i < string.length(); i++) { char c = string.charAt(i); if (i != 0) { Point2D point = vector.getGlyphPosition(i); vector.setGlyphPosition( i, new Point2D.Double(point.getX() + adjust, point.getY())); } if (c == ' ' || c == '\u00a0' || c == '\u3000') { adjust += info.getSpaceAdjust(); } else { adjust += info.getNonSpaceAdjust(); } } }
private void adjustGlyphPositions( String string, JustificationInfo info, GlyphVector vector) { float adjust = 0.0f; for (int i = 0; i < string.length(); i++) { char c = string.charAt(i); if (i != 0) { Point2D point = vector.getGlyphPosition(i); vector.setGlyphPosition( i, new Point2D.Double(point.getX() + adjust, point.getY())); } if (c == ' ' || c == '\u00a0' || c == '\u3000') { adjust += info.getSpaceAdjust(); } else { adjust += info.getNonSpaceAdjust(); } } }
private PdfTextArray makeJustificationArray(String s, JustificationInfo info) { PdfTextArray array = new PdfTextArray(); int len = s.length(); for (int i = 0; i < len; i++) { char c = s.charAt(i); array.add(Character.toString(c)); if (i != len - 1) { float offset; if (c == ' ' || c == '\u00a0' || c == '\u3000') { offset = info.getSpaceAdjust(); } else { offset = info.getNonSpaceAdjust(); } array.add((-offset / _dotsPerPoint) * 1000 / (_font.getSize2D() / _dotsPerPoint)); } } return array; }
private PdfTextArray makeJustificationArray(String s, JustificationInfo info) { PdfTextArray array = new PdfTextArray(); int len = s.length(); for (int i = 0; i < len; i++) { char c = s.charAt(i); array.add(Character.toString(c)); if (i != len - 1) { float offset; if (c == ' ' || c == '\u00a0' || c == '\u3000') { offset = info.getSpaceAdjust(); } else { offset = info.getNonSpaceAdjust(); } array.add((-offset / _dotsPerPoint) * 1000 / (_font.getSize2D() / _dotsPerPoint)); } } return array; }
private PdfTextArray makeJustificationArray(String s, JustificationInfo info) { PdfTextArray array = new PdfTextArray(); int len = s.length(); for (int i = 0; i < len; i++) { char c = s.charAt(i); array.add(Character.toString(c)); if (i != len - 1) { float offset; if (c == ' ' || c == '\u00a0' || c == '\u3000') { offset = info.getSpaceAdjust(); } else { offset = info.getNonSpaceAdjust(); } array.add((-offset / _dotsPerPoint) * 1000 / (_font.getSize2D() / _dotsPerPoint)); } } return array; }
private PdfTextArray makeJustificationArray(String s, JustificationInfo info) { PdfTextArray array = new PdfTextArray(); int len = s.length(); for (int i = 0; i < len; i++) { char c = s.charAt(i); array.add(Character.toString(c)); if (i != len - 1) { float offset; if (c == ' ' || c == '\u00a0' || c == '\u3000') { offset = info.getSpaceAdjust(); } else { offset = info.getNonSpaceAdjust(); } array.add((-offset / _dotsPerPoint) * 1000 / (_font.getSize2D() / _dotsPerPoint)); } } return array; }
private PdfTextArray makeJustificationArray(String s, JustificationInfo info) { PdfTextArray array = new PdfTextArray(); int len = s.length(); for (int i = 0; i < len; i++) { char c = s.charAt(i); array.add(Character.toString(c)); if (i != len - 1) { float offset; if (c == ' ' || c == '\u00a0' || c == '\u3000') { offset = info.getSpaceAdjust(); } else { offset = info.getNonSpaceAdjust(); } array.add((-offset / _dotsPerPoint) * 1000 / (_font.getSize2D() / _dotsPerPoint)); } } return array; }
adjust += info.getSpaceAdjust(); } else { adjust += info.getNonSpaceAdjust();
adjust += info.getSpaceAdjust(); } else { adjust += info.getNonSpaceAdjust();