code: public void setFont(Font f) {
          if (f == null)
              return;
          if (onlyShapes) {
              font = f;
              return;
          }
          if (f == font)
              return;
          font = f;
          fontSize = f.getSize2D();
          baseFont = getCachedBaseFont(f);
      }
docs: Sets the current font.