public static void testGetGlyph(String s, int x, int y, int fontSize) throws IOException {
final GlyphTable glyphTable = ttf.getGlyphTable();
final CMapTable cmapTable = ttf.getCMapTable();
final HorizontalHeaderTable hheadTable = ttf.getHorizontalHeaderTable();
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 tx = new AffineTransform();
double scale = fontSize / ascent;
tx.translate(x, y + fontSize);
System.out.println("Scale=" + scale + ", ascent=" + ascent);
tx.scale(scale, -scale);