final GeneralPath gp = new GeneralPath();
gp.moveTo(x, y);
final GlyphTable glyphTable = fontData.getGlyphTable();
final CMapTable cmapTable = fontData.getCMapTable();
final HorizontalHeaderTable hheadTable = fontData
.getHorizontalHeaderTable();
final HorizontalMetricsTable hmTable = fontData
.getHorizontalMetricsTable();
if (!(cmapTable.getNrEncodingTables() > 0)) {
throw new RuntimeException("No Encoding is found!");
}
final CMapTable.EncodingTable encTable = cmapTable
.getEncodingTable(0);
if (encTable.getTableFormat() == null) {
throw new RuntimeException("The table is NUll!!");
}
final double ascent = hheadTable.getAscent();
final AffineTransform tx2 = new AffineTransform();
final double scale = fontSize / (-hheadTable.getDescent() + ascent);
tx2.translate(x, y + fontSize);
tx2.scale(scale, -scale);
tx2.translate(0, ascent);