qnx.fuse.ui.utils.FTEUtils

FTEUtils

Methods


Packageqnx.fuse.ui.utils
Classpublic final class FTEUtils
InheritanceFTEUtils Inheritance Object

Provides helper methods for the Flash Text Engine (FTE)

Class information:
BlackBerry 10 Version:   10.0.0



Public Methods

 MethodDefined By
  
findNextWordBoundary(textBlock:TextBlock, position:int, textLength:int):int
[static] Finds the index of the next word boundary to the specified character index, not including the character at the specified index.
FTEUtils
  
findPreviousAtomBoundary(textBlock:TextBlock, position:int, textLength:int):int
[static] Finds the index of the previous atom boundary to the specified character index, not including the character at the specified index.
FTEUtils
  
findPreviousWordBoundary(textBlock:TextBlock, position:int, textLength:int):int
[static] Finds the index of the previous word boundary to the specified character index, not including the character at the specified index.
FTEUtils
  
[static] Gets the default text height for a line based on a text format.
FTEUtils
  
getFirstSpaceIndexAhead(text:String, index:int):int
[static] Returns the index of the first space found ahead of the supplied index.
FTEUtils
  
getFirstSpaceIndexBehind(text:String, index:int):int
[static] Returns the index of the first space found behind the supplied index.
FTEUtils
  
getLineMetricsFromFormat(format:TextFormat):TextLineMetrics
[static] Returns a TextLineMetrics object based on the specified format.
FTEUtils

Method Detail

findNextWordBoundary()


public static function findNextWordBoundary(textBlock:TextBlock, position:int, textLength:int):int

Finds the index of the next word boundary to the specified character index, not including the character at the specified index. Word boundaries are determined based on the Unicode properties of the characters.

Parameters

textBlock:TextBlock — The TextBlock instance to use.
position:int — Specifies the index of the character from which to search for the next word boundary.
textLength:int — The length of the text in the current text block.

Returns

int — The index of the next word boundary to the specified character index.

findPreviousAtomBoundary()


public static function findPreviousAtomBoundary(textBlock:TextBlock, position:int, textLength:int):int

Finds the index of the previous atom boundary to the specified character index, not including the character at the specified index. The characters between atom boundaries combine to form one atom in a TextLine, such as an 'e' and a combining acute accent.

Parameters

textBlock:TextBlock — The TextBlock instance to use.
position:int — Specifies the index of the character from which to search for the previous atom boundary.
textLength:int — The length of the text in the current text block.

Returns

int — The index of the previous atom boundary to the specified character index.

findPreviousWordBoundary()


public static function findPreviousWordBoundary(textBlock:TextBlock, position:int, textLength:int):int

Finds the index of the previous word boundary to the specified character index, not including the character at the specified index. Word boundaries are determined based on the Unicode properties of the characters.

Parameters

textBlock:TextBlock — The TextBlock instance to use.
position:int — Specifies the index of the character from which to search for the previous word boundary.
textLength:int — The length of the text in the current text block.

Returns

int — The index of the previous word boundary to the specified character index.

getDefaultTextHeight()


public static function getDefaultTextHeight(format:TextFormat):Number

Gets the default text height for a line based on a text format.

Parameters

format:TextFormat

Returns

Number — Returns the height of the line.

getFirstSpaceIndexAhead()


public static function getFirstSpaceIndexAhead(text:String, index:int):int

Returns the index of the first space found ahead of the supplied index. If there is no space ahead of the index, the length of the text is returned.

Parameters

text:String — The text to search.
index:int — The index to look ahead of.

Returns

int — The index of the first space ahead of the supplied index.

getFirstSpaceIndexBehind()


public static function getFirstSpaceIndexBehind(text:String, index:int):int

Returns the index of the first space found behind the supplied index.

Parameters

text:String — The text to search.
index:int — The index to look behind.

Returns

int — The index of the first space behind the supplied index.

getLineMetricsFromFormat()


public static function getLineMetricsFromFormat(format:TextFormat):TextLineMetrics

Returns a TextLineMetrics object based on the specified format.

Parameters

format:TextFormat — A text format to base the line metrics off of.

Returns

TextLineMetrics — A TextLineMetrics object based on the specified format.




comments powered by Disqus