Class Style.Builder
java.lang.Object
com.nsdev.lettergenerator.model.style.Style.Builder
- Enclosing class:
- Style
-
Method Summary
Modifier and TypeMethodDescriptionbold()Enables bold, overriding an inherited regular weight.bold(boolean value) Overrides the inherited bold flag, including explicitly disabling it.build()Snapshots the accumulated overrides without validating them or replacing nulls.Sets the text-color override.fontFamily(String value) Sets the font-family override.fontSizePt(double value) Sets the font size in points (1/72 inch).italic()Enables italic, overriding an inherited upright style.italic(boolean value) Overrides the inherited italic flag, including explicitly disabling it.keepTogether(Keep value) Sets the current block's page-keep strength.keepWithNext(Keep value) Sets the keep strength between this block and its successor.lineHeight(double value) Sets the dimensionless line-height multiplier, applied to font size.References a named style below this builder's explicit overrides.orphans(int value) Sets the minimum opening paragraph lines on a page; generation requires a positive value.spaceAfterMm(double value) Sets spacing after a block.spaceBeforeMm(double value) Sets spacing before a block.Sets horizontal paragraph alignment.Enables underlining for text.underline(boolean value) Overrides the inherited underline flag, including explicitly disabling it.widows(int value) Sets the minimum trailing paragraph lines on a page; generation requires a positive value.
-
Method Details
-
named
References a named style below this builder's explicit overrides.- Parameters:
value- registered theme name, or null to clear the reference- Returns:
- this builder
-
fontFamily
Sets the font-family override.- Parameters:
value- built-in or registered family name; null clears the override- Returns:
- this builder
-
fontSizePt
Sets the font size in points (1/72 inch). Generation requires a positive finite size.- Parameters:
value- font size in points- Returns:
- this builder
-
color
Sets the text-color override. Generation requires six hexadecimal RGB digits prefixed by#when a color is supplied.- Parameters:
value- RGB color such as#123ABC; null clears the override- Returns:
- this builder
-
bold
Enables bold, overriding an inherited regular weight.- Returns:
- this builder
-
bold
Overrides the inherited bold flag, including explicitly disabling it.- Parameters:
value- whether to render bold text- Returns:
- this builder
-
italic
Enables italic, overriding an inherited upright style.- Returns:
- this builder
-
italic
Overrides the inherited italic flag, including explicitly disabling it.- Parameters:
value- whether to render italic text- Returns:
- this builder
-
underline
Enables underlining for text.- Returns:
- this builder
-
underline
Overrides the inherited underline flag, including explicitly disabling it.- Parameters:
value- whether to underline text- Returns:
- this builder
-
textAlign
Sets horizontal paragraph alignment.- Parameters:
value- alignment override; null clears the override- Returns:
- this builder
-
lineHeight
Sets the dimensionless line-height multiplier, applied to font size. Generation requires a positive finite value. Text layout accommodates the largest run line box.- Parameters:
value- font-size multiplier, such as 1.2- Returns:
- this builder
-
spaceBeforeMm
Sets spacing before a block. Generation requires a finite nonnegative value; cell text always uses zero paragraph spacing.- Parameters:
value- spacing in millimeters- Returns:
- this builder
-
spaceAfterMm
Sets spacing after a block. Generation requires a finite nonnegative value; cell text always uses zero paragraph spacing.- Parameters:
value- spacing in millimeters- Returns:
- this builder
-
keepTogether
Sets the current block's page-keep strength.- Parameters:
value- keep policy, or null for the ordinary policy- Returns:
- this builder
-
keepTogether
- Returns:
- this builder with an ALWAYS keep for the current block
-
keepWithNext
Sets the keep strength between this block and its successor.- Parameters:
value- keep policy, or null for the ordinary policy- Returns:
- this builder
-
keepWithNext
- Returns:
- this builder with an ALWAYS keep with the next block
-
widows
Sets the minimum trailing paragraph lines on a page; generation requires a positive value.- Parameters:
value- minimum trailing line count- Returns:
- this builder
-
orphans
Sets the minimum opening paragraph lines on a page; generation requires a positive value.- Parameters:
value- minimum opening line count- Returns:
- this builder
-
build
Snapshots the accumulated overrides without validating them or replacing nulls. The builder can be changed and reused after this call.- Returns:
- a new immutable style with the current overrides
-