}
public static void drawString(Graphics g, String s, int x, int y, double fontSize) throws IOException {
final GlyphTable glyphTable = ttf.getGlyphTable();
final CMapTable cmapTable = ttf.getCMapTable();
final HorizontalHeaderTable hheadTable = ttf.getHorizontalHeaderTable();
final HorizontalMetricsTable hmTable = ttf.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 int maxAdvance = hheadTable.getMaxAdvance();
final double ascent = hheadTable.getAscent();