Package com.openhtmltopdf.layout
Class Breaker
java.lang.Object
com.openhtmltopdf.layout.Breaker
public class Breaker extends Object
A utility class that scans the text of a single inline box, looking for the
next break point.
- Author:
- Torbjoern Gannholm
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBreaker.TextBreakerSupplier -
Field Summary
Fields Modifier and Type Field Description static charSOFT_HYPHENstatic Breaker.TextBreakerSupplierSTANDARD_CHARACTER_BREAKERstatic Breaker.TextBreakerSupplierSTANDARD_LINE_BREAKER -
Constructor Summary
Constructors Constructor Description Breaker() -
Method Summary
Modifier and Type Method Description static voidbreakFirstLetter(LayoutContext c, LineBreakContext context, int avail, CalculatedStyle style)static voidbreakText(LayoutContext c, LineBreakContext context, int avail, CalculatedStyle style)static voiddoBreakText(LayoutContext c, LineBreakContext context, int avail, CalculatedStyle style, Breaker.TextBreakerSupplier characterBreaker, Breaker.TextBreakerSupplier lineBreaker, boolean tryToBreakAnywhere)static FSTextBreakergetCharacterBreakStream(String currentString, SharedContext sharedContext)static FSTextBreakergetLineBreakStream(String s, SharedContext shared)static intgetTextWidthWithLetterSpacing(CssContext c, FSFont font, String text, float letterSpacing)Gets the width of a string with letter spacing factored in.
-
Field Details
-
SOFT_HYPHEN
public static final char SOFT_HYPHEN- See Also:
- Constant Field Values
-
STANDARD_CHARACTER_BREAKER
-
STANDARD_LINE_BREAKER
-
-
Constructor Details
-
Breaker
public Breaker()
-
-
Method Details
-
breakFirstLetter
public static void breakFirstLetter(LayoutContext c, LineBreakContext context, int avail, CalculatedStyle style) -
breakText
public static void breakText(LayoutContext c, LineBreakContext context, int avail, CalculatedStyle style) -
doBreakText
public static void doBreakText(LayoutContext c, LineBreakContext context, int avail, CalculatedStyle style, Breaker.TextBreakerSupplier characterBreaker, Breaker.TextBreakerSupplier lineBreaker, boolean tryToBreakAnywhere) -
getCharacterBreakStream
public static FSTextBreaker getCharacterBreakStream(String currentString, SharedContext sharedContext) -
getLineBreakStream
-
getTextWidthWithLetterSpacing
public static int getTextWidthWithLetterSpacing(CssContext c, FSFont font, String text, float letterSpacing)Gets the width of a string with letter spacing factored in. Favor this method over using the text renderer directly.
-