public float getFontImageWidth() {
    float a, w = 0;
    for (String s : key_table.values()) {
      a = (float) fontMetrics.getStringBounds(s, null).getWidth();
      if (a > w) w = a;
    }

    return w;
  }
  public float getCharX(char c) {
    String originStr = String.valueOf(c);

    for (String s : key_table.values()) {
      if (s.contains(originStr)) originStr = s;
    }

    return (float)
        fontMetrics.getStringBounds(originStr.substring(0, originStr.indexOf(c)), null).getWidth();
  }
 public int stringWidth(String s) {
   return fontMetrics.stringWidth(s);
 }
 public float charWidth(int c) {
   return fontMetrics.charWidth(c);
 }
 public int getHeight() {
   return (int) (fontMetrics.getHeight());
 }