code: private static FontStyle stringToFontStyle(String style) {
          if (style.compareToIgnoreCase("plain") == 0) {
              return FontStyle.PLAIN;
          } else if (style.compareToIgnoreCase("bold") == 0) {
              return FontStyle.BOLD;
          } else if (style.compareToIgnoreCase("italic") == 0) {
              return FontStyle.ITALIC;
          } else {
              throw new IllegalArgumentException();
          }
      }
docs: Return FontStyle enum value from a font style name.
  
  @param style
  A style name like "italic".
  @return FontStyle enum value.