@Override
    public boolean equals(Object obj){
         if (obj == this) {
            return true;
        }

        if (obj != null) {
          try {
            Glyph gl = (Glyph)obj;

            return  ((this.getChar() == gl.getChar())
              && (this.getGlyphMetrics().equals(gl.getGlyphMetrics()))
              && (this.getGlyphCode() == gl.getGlyphCode()));
          } catch (ClassCastException e) {
          }
        }

        return false;
    }