TextRenderer extends AbstractRenderer implements ILeafElementRenderer { @Override public float getDescent() { return -(getOccupiedAreaBBox().getHeight() - yLineOffset - (float) this.getPropertyAsFloat(Property.TEXT_RISE)); } TextRenderer(Text textElement);  TextRenderer(Text textElement, String text); protected  TextRenderer(TextRenderer other); @Override LayoutResult layout(LayoutContext layoutContext); void applyOtf(); @Override void draw(DrawContext drawContext); void trimFirst(); @Override float getAscent(); @Override float getDescent(); float getYLine(); void moveYLineTo(float y); void setText(String text); @Deprecated void setText(GlyphLine text, int leftPos, int rightPos); void setText(GlyphLine text, PdfFont font); GlyphLine getText(); int length(); @Override String toString(); int charAt(int pos); float getTabAnchorCharacterPosition(); @Override IRenderer getNextRenderer(); static float[] calculateAscenderDescender(PdfFont font); static float[] calculateAscenderDescender(PdfFont font, RenderingMode mode); @Override MinMaxWidth getMinMaxWidth();  }
@Test public void getDescentTest() { Document doc = createDocument(); TextRenderer textRenderer = createLayoutedTextRenderer("hello", doc); textRenderer.setProperty(Property.PADDING_TOP, UnitValue.createPointValue(20f)); textRenderer.setProperty(Property.MARGIN_TOP, UnitValue.createPointValue(20f)); Assert.assertEquals(-2.980799674987793f, textRenderer.getDescent(), EPS); }