Package com.teamten.typeset
Class ParagraphStyle
java.lang.Object
com.teamten.typeset.ParagraphStyle
Describes various layout attributes about a paragraph.
-
Constructor Summary
ConstructorsConstructorDescriptionParagraphStyle
(boolean center, boolean newPage, boolean oddPage, boolean ownPage, boolean allowLineBreaks, long marginTop, long marginBottom, long marginLeft, long marginRight, boolean resetFootnoteNumber, long leading, long paragraphIndent, long firstLineIndent, long subsequentLinesIndent, boolean preventBreak, FontPack fontPack) -
Method Summary
Modifier and TypeMethodDescriptionstatic ParagraphStyle
forBlock
(Block block, @Nullable Block previousBlock, Config config, FontManager fontManager) long
Indent for the first line.The font pack for this paragraph.long
The leading for paragraph lines.long
The margin below the paragraph.long
The margin to the left of the paragraph, in addition to the various indents.long
The margin to the right of the paragraph, in addition to the various indents.long
The margin above the paragraph.long
Indent size, whether used or not.long
Indent for all lines but the first.boolean
Whether to allow line breaks in this paragraph.boolean
isCenter()
Whether to center the whole paragraph.boolean
Whether the block should start a new page.boolean
Whether the block should start a new odd page (skipping an even page if necessary).boolean
Whether the block should be on its own page (starting a new page and ejecting afterward).boolean
Whether to reset the footnote number to 1 before processing this paragraph.makeOutputShape
(long bodyWidth) Creates an OutputShape object corresponding to this style for the specified body width.boolean
Whether to prevent a page break after this paragraph (for titles).withScaledFont
(double scale) Return a new paragraph size, identical except the font pack is scaled by the specified amount.
-
Constructor Details
-
ParagraphStyle
public ParagraphStyle(boolean center, boolean newPage, boolean oddPage, boolean ownPage, boolean allowLineBreaks, long marginTop, long marginBottom, long marginLeft, long marginRight, boolean resetFootnoteNumber, long leading, long paragraphIndent, long firstLineIndent, long subsequentLinesIndent, boolean preventBreak, FontPack fontPack)
-
-
Method Details
-
isCenter
public boolean isCenter()Whether to center the whole paragraph. -
isNewPage
public boolean isNewPage()Whether the block should start a new page. -
isOddPage
public boolean isOddPage()Whether the block should start a new odd page (skipping an even page if necessary). -
isOwnPage
public boolean isOwnPage()Whether the block should be on its own page (starting a new page and ejecting afterward). -
isAllowLineBreaks
public boolean isAllowLineBreaks()Whether to allow line breaks in this paragraph. For example, we don't want line breaks in code. -
getMarginTop
public long getMarginTop()The margin above the paragraph. -
getMarginBottom
public long getMarginBottom()The margin below the paragraph. -
getMarginLeft
public long getMarginLeft()The margin to the left of the paragraph, in addition to the various indents. -
getMarginRight
public long getMarginRight()The margin to the right of the paragraph, in addition to the various indents. -
isResetFootnoteNumber
public boolean isResetFootnoteNumber()Whether to reset the footnote number to 1 before processing this paragraph. This is done for new chapters. -
getLeading
public long getLeading()The leading for paragraph lines. -
getParagraphIndent
public long getParagraphIndent()Indent size, whether used or not. -
getFirstLineIndent
public long getFirstLineIndent()Indent for the first line. -
getSubsequentLinesIndent
public long getSubsequentLinesIndent()Indent for all lines but the first. -
preventBreak
public boolean preventBreak()Whether to prevent a page break after this paragraph (for titles). -
getFontPack
The font pack for this paragraph. -
makeOutputShape
Creates an OutputShape object corresponding to this style for the specified body width. -
withScaledFont
Return a new paragraph size, identical except the font pack is scaled by the specified amount. -
forBlock
public static ParagraphStyle forBlock(Block block, @Nullable @Nullable Block previousBlock, Config config, FontManager fontManager)
-