Package com.helger.pdflayout.spec
Class FontSpec
java.lang.Object
com.helger.pdflayout.spec.FontSpec
- All Implemented Interfaces:
Serializable
@NotThreadSafe
@MustImplementEqualsAndHashcode
public class FontSpec
extends Object
implements Serializable
Defines a text font specification containing the font, the font size and the
text color.
- Author:
- Philip Helger
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionFontSpec(PreloadFont aPreloadFont, float fFontSize) Constructor with aPreloadFontand a font size, using the default colorDEFAULT_COLOR.FontSpec(PreloadFont aPreloadFont, float fFontSize, PLColor aColor) Constructor with aPreloadFont, a font size and a custom color. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetCloneWithDifferentColor(PLColor aNewColor) Return a clone of this object but with a different color.getCloneWithDifferentFont(PreloadFont aNewFont) Return a clone of this object but with a different font.getCloneWithDifferentFontSize(float fNewFontSize) Return a clone of this object but with a different font size.final PLColorgetColor()final floatfinal PreloadFontfinal StringinthashCode()toString()
-
Field Details
-
DEFAULT_COLOR
The default font color: black
-
-
Constructor Details
-
FontSpec
Constructor with aPreloadFontand a font size, using the default colorDEFAULT_COLOR.- Parameters:
aPreloadFont- Preload font to use. May not benull.fFontSize- Font size to use. Must be > 0.
-
FontSpec
public FontSpec(@Nonnull PreloadFont aPreloadFont, @Nonnegative float fFontSize, @Nonnull PLColor aColor) Constructor with aPreloadFont, a font size and a custom color.- Parameters:
aPreloadFont- Preload font to use. May not benull.fFontSize- Font size to use. Must be > 0.aColor- The color to use. May not benull.- Since:
- 7.2.0
-
-
Method Details
-
getPreloadFont
- Returns:
- The font to use. Never
null.
-
getPreloadFontID
- Returns:
- The ID of the font to use. Never
null.
-
getFontSize
- Returns:
- The font size in points. Always > 0.
-
getColor
- Returns:
- The text color to use.
-
getCloneWithDifferentFont
Return a clone of this object but with a different font.- Parameters:
aNewFont- The new font to use. Must not benull.- Returns:
- this if the fonts are equal - a new object otherwise.
-
getCloneWithDifferentFontSize
Return a clone of this object but with a different font size.- Parameters:
fNewFontSize- The new font size to use. Must be > 0.- Returns:
- this if the font sizes are equal - a new object otherwise.
-
getCloneWithDifferentColor
Return a clone of this object but with a different color.- Parameters:
aNewColor- The new color to use. May not benull.- Returns:
- this if the colors are equal - a new object otherwise.
- Since:
- 7.2.0
-
equals
-
hashCode
public int hashCode() -
toString
-