Enum Class StandardFontMapper

java.lang.Object
java.lang.Enum<StandardFontMapper>
com.dua3.utility.text.StandardFontMapper
All Implemented Interfaces:
Serializable, Comparable<StandardFontMapper>, Constable, Function<@Nullable String,@Nullable String>

public enum StandardFontMapper extends Enum<StandardFontMapper> implements Function<@Nullable String,@Nullable String>
Enum class with entries for standard font mappers. This class implements the Function interface to provide a mapping from one font family name to another.
  • Enum Constant Details

    • IDENTITY

      public static final StandardFontMapper IDENTITY
      Do not map the font family name.
    • IGNORE_SUBSETS

      public static final StandardFontMapper IGNORE_SUBSETS
      Remove subset prefixes from partially embedded fonts invPDF-files.

      Example usage:

       String input = "ABCDEF+Arial";
       String result = IGNORE_SUBSETS.apply(input);
       System.out.println(result); // Output: "Arial"
       
    • KNOWN_ALIASES

      public static final StandardFontMapper KNOWN_ALIASES
      Map known font name aliases to the corresponding standard font.

      Example usage:

       String fontAlias = "ArialMT";
       String fontName = KNOWN_ALIASES.apply(fontAlias);
       System.out.println(fontName); // Output: Arial
       
    • IGNORE_SUBSETS_AND_KNOWN_ALIASES

      public static final StandardFontMapper IGNORE_SUBSETS_AND_KNOWN_ALIASES
      Remove subset prefixes from font names, then map known font name aliases to the corresponding standard font.

      Example usage:

       String fontAlias = "ABCDEF+ArialMT";
       String fontName = KNOWN_ALIASES.apply(fontAlias);
       System.out.println(fontName); // Output: Arial
       
  • Method Details

    • values

      public static StandardFontMapper[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static StandardFontMapper valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • apply

      public @Nullable String apply(@Nullable String s)
      Specified by:
      apply in interface Function<@Nullable String,@Nullable String>