Package io.github.dornol.excelkit.excel
Class ExcelRichText.FontStyle
java.lang.Object
io.github.dornol.excelkit.excel.ExcelRichText.FontStyle
- Enclosing class:
ExcelRichText
Style configuration for a rich text segment.
Supports bold, italic, underline, strikethrough, font color (RGB), and font size.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbold(boolean bold) Sets bold styling.color(int r, int g, int b) Sets the font color using RGB values.color(ExcelColor color) Sets the font color using a predefinedExcelColor.fontSize(int size) Sets the font size in points.italic(boolean italic) Sets italic styling.strikethrough(boolean strikethrough) Sets strikethrough styling.underline(boolean underline) Sets underline styling.
-
Constructor Details
-
FontStyle
public FontStyle()Creates a new font style with defaults.
-
-
Method Details
-
bold
Sets bold styling.- Parameters:
bold- whether to apply bold- Returns:
- this instance for chaining
-
italic
Sets italic styling.- Parameters:
italic- whether to apply italic- Returns:
- this instance for chaining
-
underline
Sets underline styling.- Parameters:
underline- whether to apply underline- Returns:
- this instance for chaining
-
strikethrough
Sets strikethrough styling.- Parameters:
strikethrough- whether to apply strikethrough- Returns:
- this instance for chaining
-
color
Sets the font color using RGB values.- Parameters:
r- red component (0–255)g- green component (0–255)b- blue component (0–255)- Returns:
- this instance for chaining
-
color
Sets the font color using a predefinedExcelColor.- Parameters:
color- the color preset- Returns:
- this instance for chaining
-
fontSize
Sets the font size in points.- Parameters:
size- font size in points- Returns:
- this instance for chaining
-