Example #1
0
  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;
  }
Example #2
0
  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();
  }
Example #3
0
 public int stringWidth(String s) {
   return fontMetrics.stringWidth(s);
 }
Example #4
0
 public float charWidth(int c) {
   return fontMetrics.charWidth(c);
 }
Example #5
0
 public int getHeight() {
   return (int) (fontMetrics.getHeight());
 }