DefaultCanvasLogicHandler implements ClassicBarcodeLogicHandler { protected double getTextBaselinePosition() { if (bcBean.getMsgPosition() == HumanReadablePlacement.HRP_TOP) { double ty = bcBean.getHumanReadableHeight(); if (bcBean.hasFontDescender()) { ty -= bcBean.getHumanReadableHeight() / 13 * 3; } return ty; } else if (bcBean.getMsgPosition() == HumanReadablePlacement.HRP_BOTTOM) { double ty = bcBean.getHeight(); if (bcBean.hasFontDescender()) { ty -= bcBean.getHumanReadableHeight() / 13 * 3; } return ty; } else { throw new IllegalStateException("not applicable"); } } DefaultCanvasLogicHandler(AbstractBarcodeBean bcBean, Canvas canvas); @Override void startBarcode(String msg, String formattedMsg); @Override void startBarGroup(BarGroup type, String submsg); @Override void addBar(boolean black, int width); @Override void endBarGroup(); @Override void endBarcode();  }
@Test public void testGetTextBaselinePosition() { System.out.println("getTextBaselinePosition"); double expResult = 0.0; double result = instance.getTextBaselinePosition(); }