Klasse FxFontUtil

java.lang.Object
com.dua3.utility.fx.FxFontUtil
Alle implementierten Schnittstellen:
com.dua3.utility.text.FontUtil<Font>

public class FxFontUtil extends Object implements com.dua3.utility.text.FontUtil<Font>
Utility class for working with fonts in JavaFX.
  • Verschachtelte Klassen - Übersicht

    Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen com.dua3.utility.text.FontUtil

    com.dua3.utility.text.FontUtil.FontTypes
  • Methodenübersicht

    Modifizierer und Typ
    Methode
    Beschreibung
    convert(com.dua3.utility.text.Font font)
    Converts a com.dua3.utility.text.Font object to a JavaFX Font object.
    com.dua3.utility.text.Font
    convert(Font fxFont)
    Converts a JavaFX Font object to a com.dua3.utility.text.Font object.
    com.dua3.utility.text.Font
    deriveFont(com.dua3.utility.text.Font font, com.dua3.utility.text.FontDef fontDef)
     
    com.dua3.utility.text.Font
     
    getFamilies(com.dua3.utility.text.FontUtil.FontTypes types)
     
    static com.dua3.utility.text.FontData
    getFontData(Font fxFont)
    Extracts font data from a JavaFX Font object.
    static com.dua3.utility.text.FontDef
    getFontDef(Font fxFont)
    Extracts font characteristics from a JavaFX Font object and creates a corresponding FontDef object.
    static FxFontUtil
    Returns an instance of FxUtil.
    com.dua3.utility.math.geometry.Rectangle2f
    getTextDimension(CharSequence s, com.dua3.utility.text.Font f)
     
    com.dua3.utility.math.geometry.Rectangle2f
    Calculates the dimensions of the given text when rendered with the specified font.
    double
    getTextHeight(CharSequence s, com.dua3.utility.text.Font f)
     
    double
    getTextWidth(CharSequence s, com.dua3.utility.text.Font f)
     
    com.dua3.utility.text.Font
    loadFontAs(InputStream in, com.dua3.utility.text.Font font)
     
    List<com.dua3.utility.text.Font>
     

    Von Klasse geerbte Methoden java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Von Schnittstelle geerbte Methoden com.dua3.utility.text.FontUtil

    getFamilies, getFont, getFont, getRichTextDimension
  • Methodendetails

    • getInstance

      public static FxFontUtil getInstance()
      Returns an instance of FxUtil.
      Gibt zurück:
      the instance of FxUtil
    • convert

      public Font convert(com.dua3.utility.text.Font font)
      Converts a com.dua3.utility.text.Font object to a JavaFX Font object.
      Angegeben von:
      convert in Schnittstelle com.dua3.utility.text.FontUtil<Font>
      Parameter:
      font - the com.dua3.utility.text.Font object to be converted
      Gibt zurück:
      the converted JavaFX Font object
    • convert

      public com.dua3.utility.text.Font convert(Font fxFont)
      Converts a JavaFX Font object to a com.dua3.utility.text.Font object.
      Angegeben von:
      convert in Schnittstelle com.dua3.utility.text.FontUtil<Font>
      Parameter:
      fxFont - the JavaFX Font object to be converted
      Gibt zurück:
      the converted com.dua3.utility.text.Font object
    • getFontData

      public static com.dua3.utility.text.FontData getFontData(Font fxFont)
      Extracts font data from a JavaFX Font object.
      Parameter:
      fxFont - the JavaFX Font object from which the font data is extracted
      Gibt zurück:
      a FontData object containing detailed information about the font, including its family, size, style attributes such as bold, italic, underline, and strike-through, and additional metrics like ascent, descent, height, and space width
    • getFontDef

      public static com.dua3.utility.text.FontDef getFontDef(Font fxFont)
      Extracts font characteristics from a JavaFX Font object and creates a corresponding FontDef object.
      Parameter:
      fxFont - the JavaFX Font object to be analyzed
      Gibt zurück:
      a FontDef object containing the extracted font properties such as family, size, bold, italic, underline, and strikethrough
    • getTextDimension

      public com.dua3.utility.math.geometry.Rectangle2f getTextDimension(CharSequence s, com.dua3.utility.text.Font f)
      Angegeben von:
      getTextDimension in Schnittstelle com.dua3.utility.text.FontUtil<Font>
    • getTextDimension

      public com.dua3.utility.math.geometry.Rectangle2f getTextDimension(CharSequence s, Font f)
      Calculates the dimensions of the given text when rendered with the specified font.
      Parameter:
      s - the text to measure
      f - the font used to render the text
      Gibt zurück:
      a Rectangle2f object representing the dimensions of the rendered text
    • getTextWidth

      public double getTextWidth(CharSequence s, com.dua3.utility.text.Font f)
      Angegeben von:
      getTextWidth in Schnittstelle com.dua3.utility.text.FontUtil<Font>
    • getTextHeight

      public double getTextHeight(CharSequence s, com.dua3.utility.text.Font f)
      Angegeben von:
      getTextHeight in Schnittstelle com.dua3.utility.text.FontUtil<Font>
    • loadFonts

      public List<com.dua3.utility.text.Font> loadFonts(InputStream in)
      Angegeben von:
      loadFonts in Schnittstelle com.dua3.utility.text.FontUtil<Font>
    • getFamilies

      public List<String> getFamilies(com.dua3.utility.text.FontUtil.FontTypes types)
      Angegeben von:
      getFamilies in Schnittstelle com.dua3.utility.text.FontUtil<Font>
    • loadFontAs

      public com.dua3.utility.text.Font loadFontAs(InputStream in, com.dua3.utility.text.Font font) throws IOException
      Angegeben von:
      loadFontAs in Schnittstelle com.dua3.utility.text.FontUtil<Font>
      Löst aus:
      IOException
    • getDefaultFont

      public com.dua3.utility.text.Font getDefaultFont()
      Angegeben von:
      getDefaultFont in Schnittstelle com.dua3.utility.text.FontUtil<Font>
    • deriveFont

      public com.dua3.utility.text.Font deriveFont(com.dua3.utility.text.Font font, com.dua3.utility.text.FontDef fontDef)
      Angegeben von:
      deriveFont in Schnittstelle com.dua3.utility.text.FontUtil<Font>