Class FontStack

java.lang.Object
net.sourceforge.plantuml.klimt.font.FontStack

public class FontStack extends Object
  • Constructor Details

    • FontStack

      public FontStack(String fullDefinition)
  • Method Details

    • canDisplayUpTo

      public int canDisplayUpTo(int index, String text)
    • getFont

      @Deprecated public Font getFont(String text, int style, int size)
      Deprecated.
      Prefer getFont(String, UFontFace, int) to honour intermediate CSS weights (100-900).
      Legacy font creation using binary bold/italic style flags.
    • getFont

      public Font getFont(String text, UFontFace face, int size)
      Face-aware font creation. Selects the first family font that can display the given text (or falls back to the primary family), resizes it, then applies both the italic axis and CSS weight via UFontFace.deriveFont(Font).

      When the weight is a standard binary value (400 or 700) the result is identical to the legacy path. For intermediate weights (100-300, 500-600, 800-900) is used so that fonts with matching weight faces (e.g. Helvetica Neue) render at the requested weight.

      Parameters:
      text - the string to be rendered (used for font-family fallback selection, may be null)
      face - the font face (weight + italic axis)
      size - the point size
      Returns:
      a Font ready for Java2D rendering or metric measurement
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getFullDefinition

      public String getFullDefinition()