|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.foray.text.line.LineBreaker
public abstract class LineBreaker
Abstract superclass for all line breakers.
Constructor Summary | |
---|---|
protected |
LineBreaker(TextServer4a server,
org.axsl.text.line.LineBreakControl control,
org.axsl.text.line.LineBreakHandler handler,
org.axsl.font.FontConsumer fontConsumer)
Constructor. |
Method Summary | |
---|---|
static boolean |
allowsLineBreak(int codePoint)
Determines whether a character allows (but does not force) a line break. |
static boolean |
canBreakMidWord(String language)
Indicates the validity of breaking a word in the middle without hyphenation, based on a given language. |
protected int |
charWidth(org.axsl.text.line.LineText lineText,
int codePoint,
int whitespaceWidth)
Computes the width of a given character. |
static boolean |
forcesLineBreak(int codePoint)
Determines whether a character forces a line break. |
int |
getCharWidth(org.axsl.text.line.LineText lineText,
int codePoint)
Returns the width of a character. |
protected org.axsl.font.FontConsumer |
getFontConsumer()
Returns the font consumer. |
org.axsl.text.line.LineBreakHandler |
getHandler()
Returns the handler. |
int |
getHyphenWidth(org.axsl.text.line.LineText lineText)
Returns the width of the hyphenation character. |
org.axsl.text.line.LineBreakControl |
getLineBreakControl()
Return the LineBreakControl instance. |
org.apache.commons.logging.Log |
getLogger()
Returns the logger. |
TextServer4a |
getTextServer()
Return the text server. |
int |
getWordWidth(org.axsl.text.line.LineText lineText,
CharSequence word,
int offset,
int length)
Compute the width of a given word. |
boolean |
isInLowerCase()
Indicates whether the current chunk of text is lower-case for purposes of faux small-caps or not. |
boolean |
isLowerCase(int codePoint)
Indicates whether a given Unicode code point should be considered to be lower case. |
static boolean |
isNonBreakingSpace(int codePoint)
Determine if a given character is a non-breaking space. |
static boolean |
isSpace(int codePoint)
Helper method to determine if the character is a space with normal behavior. |
boolean |
isUpperCase(int codePoint)
Indicates whether a given Unicode code point should be considered to be upper case. |
static boolean |
isWhitespace(int codePoint)
Indicates whether a given character should be considered whitespace. |
static boolean |
isZeroWidthSpace(int codePoint)
Indicates whether a given character is a zero-width space. |
void |
setInLowerCase(boolean inLowerCase)
Sets the "in-lower-case" value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected LineBreaker(TextServer4a server, org.axsl.text.line.LineBreakControl control, org.axsl.text.line.LineBreakHandler handler, org.axsl.font.FontConsumer fontConsumer)
server
- The "parent" TextServer.control
- The client object that provides process-time information,
specifically by providing line length information.handler
- The client object that is responsible for taking the
results of the line-breaking work and doing something with it.fontConsumer
- Provides the line-breaking system with the
FontConsumer instance that should be used for interfacing with the Font
subsystem.Method Detail |
---|
public int getCharWidth(org.axsl.text.line.LineText lineText, int codePoint)
lineText
- The object containing information about font and font
size needed to get the width.codePoint
- The Unicode code point whose width is needed.
codePoint
, in millipoints.public boolean isLowerCase(int codePoint)
codePoint
- The Unicode code point to be tested.
codePoint
is lower case.public boolean isUpperCase(int codePoint)
codePoint
- The Unicode code point to be tested.
codePoint
is upper case.public int getHyphenWidth(org.axsl.text.line.LineText lineText)
lineText
- The object containing information about font, font size,
and hyphenation character needed to get the width.
public static boolean isSpace(int codePoint)
codePoint
- The Unicode code point to be tested.
codePoint
is a normal space.public static boolean isNonBreakingSpace(int codePoint)
codePoint
- The Unicode code point to be tested.
codePoint
is a non-breaking space.public static boolean forcesLineBreak(int codePoint)
codePoint
- The character to be tested.
public static boolean allowsLineBreak(int codePoint)
codePoint
- The character to be tested.
public static boolean isWhitespace(int codePoint)
codePoint
- The Unicode code point to be tested.
codePoint
is whitespace.public static boolean isZeroWidthSpace(int codePoint)
codePoint
- The Unicode code point to be tested.
codePoint
is a zero-width space.protected int charWidth(org.axsl.text.line.LineText lineText, int codePoint, int whitespaceWidth)
lineText
- The object which knows the font and font size information
for the text tested.codePoint
- The Unicode code point whose width is needed.whitespaceWidth
- The pre-computed whitespace width for this font.
protected org.axsl.font.FontConsumer getFontConsumer()
public org.apache.commons.logging.Log getLogger()
public static boolean canBreakMidWord(String language)
language
- The language code to be tested.
public TextServer4a getTextServer()
public int getWordWidth(org.axsl.text.line.LineText lineText, CharSequence word, int offset, int length)
lineText
- The object providing font and font size information.word
- The word whose size is needed.offset
- The zero-based index into chars
that is the start of what should be computed.length
- The number of chars in chars
that should be computed.
word
.public boolean isInLowerCase()
public void setInLowerCase(boolean inLowerCase)
inLowerCase
- Indicates whether the current chunk of text is
lower-case for purposes of faux small-caps or not.public org.axsl.text.line.LineBreakHandler getHandler()
public org.axsl.text.line.LineBreakControl getLineBreakControl()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |