Package org.openpatch.scratch.internal
Class Font
java.lang.Object
org.openpatch.scratch.internal.Font
The Font class represents a font that can be used to render text on the screen. It supports
various functionalities such as loading fonts from files, setting font sizes, and getting the
font object for a specific size.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic processing.core.PFont
Returns the default font.processing.core.PFont
getFont
(int targetSize) getName()
Returns the name of the font.static AbstractMap<Integer,
processing.core.PFont> Loads a font from the specified path and returns a map of font sizes.
-
Field Details
-
defaultFontName
The default font name. -
defaultFontPath
The default font path. -
defaultFont
public static processing.core.PFont defaultFontThe default font.
-
-
Constructor Details
-
Font
Constructs a font with the specified name and path.- Parameters:
name
- the name of the fontpath
- the path to the font file
-
Font
Copy constructor.- Parameters:
font
- the font to copy
-
-
Method Details
-
getName
Returns the name of the font.- Returns:
- the name of the font
-
getDefaultFont
public static processing.core.PFont getDefaultFont()Returns the default font.- Returns:
- the default font
-
loadFont
Loads a font from the specified path and returns a map of font sizes.- Parameters:
path
- the path to the font file- Returns:
- a map of font sizes
-
getFont
public processing.core.PFont getFont(int targetSize)
-