if (s.length() == 0) { s = String.valueOf(fontFace.getAscent());
if (s.length() == 0) { s = String.valueOf(fontFace.getAscent());
if (s.length() == 0) { s = String.valueOf(fontFace.getAscent());
protected GVTLineMetrics getLineMetrics(int beginIndex, int limit) { if (lineMetrics != null) return lineMetrics; float fontHeight = fontFace.getUnitsPerEm(); float scale = fontSize/fontHeight; float ascent = fontFace.getAscent() * scale; float descent = fontFace.getDescent() * scale; float[] baselineOffsets = new float[3]; baselineOffsets[Font.ROMAN_BASELINE] = 0; baselineOffsets[Font.CENTER_BASELINE] = (ascent+descent)/2-ascent; baselineOffsets[Font.HANGING_BASELINE] = -ascent; float stOffset = fontFace.getStrikethroughPosition() * -scale; float stThickness = fontFace.getStrikethroughThickness() * scale; float ulOffset = fontFace.getUnderlinePosition() * scale; float ulThickness = fontFace.getUnderlineThickness() * scale; float olOffset = fontFace.getOverlinePosition() * -scale; float olThickness = fontFace.getOverlineThickness() * scale; lineMetrics = new GVTLineMetrics (ascent, Font.ROMAN_BASELINE, baselineOffsets, descent, fontHeight, fontHeight, limit-beginIndex, stOffset, stThickness, ulOffset, ulThickness, olOffset, olThickness); return lineMetrics; }
protected GVTLineMetrics getLineMetrics(int beginIndex, int limit) { if (lineMetrics != null) return lineMetrics; float fontHeight = fontFace.getUnitsPerEm(); float scale = fontSize/fontHeight; float ascent = fontFace.getAscent() * scale; float descent = fontFace.getDescent() * scale; float[] baselineOffsets = new float[3]; baselineOffsets[Font.ROMAN_BASELINE] = 0; baselineOffsets[Font.CENTER_BASELINE] = (ascent+descent)/2-ascent; baselineOffsets[Font.HANGING_BASELINE] = -ascent; float stOffset = fontFace.getStrikethroughPosition() * -scale; float stThickness = fontFace.getStrikethroughThickness() * scale; float ulOffset = fontFace.getUnderlinePosition() * scale; float ulThickness = fontFace.getUnderlineThickness() * scale; float olOffset = fontFace.getOverlinePosition() * -scale; float olThickness = fontFace.getOverlineThickness() * scale; lineMetrics = new GVTLineMetrics (ascent, Font.ROMAN_BASELINE, baselineOffsets, descent, fontHeight, fontHeight, limit-beginIndex, stOffset, stThickness, ulOffset, ulThickness, olOffset, olThickness); return lineMetrics; }
protected GVTLineMetrics getLineMetrics(int beginIndex, int limit) { if (lineMetrics != null) return lineMetrics; float fontHeight = fontFace.getUnitsPerEm(); float scale = fontSize/fontHeight; float ascent = fontFace.getAscent() * scale; float descent = fontFace.getDescent() * scale; float[] baselineOffsets = new float[3]; baselineOffsets[Font.ROMAN_BASELINE] = 0; baselineOffsets[Font.CENTER_BASELINE] = (ascent+descent)/2-ascent; baselineOffsets[Font.HANGING_BASELINE] = -ascent; float stOffset = fontFace.getStrikethroughPosition() * -scale; float stThickness = fontFace.getStrikethroughThickness() * scale; float ulOffset = fontFace.getUnderlinePosition() * scale; float ulThickness = fontFace.getUnderlineThickness() * scale; float olOffset = fontFace.getOverlinePosition() * -scale; float olThickness = fontFace.getOverlineThickness() * scale; lineMetrics = new GVTLineMetrics (ascent, Font.ROMAN_BASELINE, baselineOffsets, descent, fontHeight, fontHeight, limit-beginIndex, stOffset, stThickness, ulOffset, ulThickness, olOffset, olThickness); return lineMetrics; }