code: public boolean isOtherFont(Font font) {
          try {
              Font cFont = (Font) currentfont.peek();
              if (cFont.compareTo(font) == 0) return false;
              return true;
          }
          catch(EmptyStackException ese) {
              if (standardfont.compareTo(font) == 0) return false;
              return true;
          }
      }
docs: Checks if a given font is the same as the font that was last used.
  
  @param   font    the font of an object
  @return  true if the font differs