Packageorg.purepdf.elements
Classpublic class Phrase
InheritancePhrase Inheritance Object
Implements ITextElementaryArray, IIterable
Subclasses Anchor, Paragraph

A Phrase contains a series of Chunks. A Phrase has a main Font, but some chunks within the phrase can have different Font than the main phrase font. All the Chunks in a Phrase have the same leading. Example:
	 // When no parameters are passed, the default leading = 16
	 var phrase1: Phrase = new Phrase("this is a phrase");
	 var phrase2: Phrase = new Phrase("this is a phrase", new Font( Font.HELVETICA, 12, Font.BOLD ), 20 );
	 

See also

Element
Chunk
Paragraph
Anchor


Public Properties
 PropertyDefined By
  font : Font
Phrase
  hasLeading : Boolean
[read-only] Checks you if the leading of this phrase is defined.
Phrase
  isContent : Boolean
[read-only]
Phrase
  isEmpty : Boolean
[read-only]
Phrase
  isNestable : Boolean
[read-only]
Phrase
  leading : Number
Phrase
  size : uint
[read-only]
Phrase
  type : int
[read-only]
Phrase
Protected Properties
 PropertyDefined By
  _array : Vector.<Object>
Phrase
  _font : Font
Phrase
  _leading : Number = NaN
Phrase
Public Methods
 MethodDefined By
  
Phrase($text:String, $font:Font, $leading:Number)
Phrase
  
add(o:Object):Boolean
Adds a Chunk, Ancor or another Phrase
Phrase
  
addAll(collection:IIterable):Boolean
Phrase
  
[static]
Phrase
  
getChunks():Vector.<Object>
Phrase
  
getValue(index:int):Object
Phrase
  
initFromChunk(chunk:Chunk):void
Phrase
  
initFromPhrase(phrase:Phrase):void
Phrase
  
insert(index:int, o:Object):void
Phrase
  
iterator():Iterator
Phrase
  
process(listener:IElementListener):Boolean
Phrase
  
push(o:Object):Boolean
Phrase
  
toString():String
Phrase
Protected Methods
 MethodDefined By
  
addChunk(chunk:Chunk):Boolean
Adds a Chunk.
Phrase
Public Constants
 ConstantDefined By
  DEFAULT_LEADING : int = 16
[static]
Phrase
Property Detail
_arrayproperty
protected var _array:Vector.<Object>

_fontproperty 
protected var _font:Font

_leadingproperty 
protected var _leading:Number = NaN

fontproperty 
font:Font


Implementation
    public function get font():Font
    public function set font(value:Font):void
hasLeadingproperty 
hasLeading:Boolean  [read-only]

Checks you if the leading of this phrase is defined.


Implementation
    public function get hasLeading():Boolean
isContentproperty 
isContent:Boolean  [read-only]


Implementation
    public function get isContent():Boolean
isEmptyproperty 
isEmpty:Boolean  [read-only]


Implementation
    public function get isEmpty():Boolean
isNestableproperty 
isNestable:Boolean  [read-only]


Implementation
    public function get isNestable():Boolean
leadingproperty 
leading:Number


Implementation
    public function get leading():Number
    public function set leading(value:Number):void
sizeproperty 
size:uint  [read-only]


Implementation
    public function get size():uint
typeproperty 
type:int  [read-only]


Implementation
    public function get type():int
Constructor Detail
Phrase()Constructor
public function Phrase($text:String, $font:Font, $leading:Number)



Parameters
$text:String
 
$font:Font
 
$leading:Number (default = NaN)
Method Detail
add()method
public function add(o:Object):Boolean

Adds a Chunk, Ancor or another Phrase

Parameters

o:Object

Returns
Boolean

Throws
CastTypeError allowed — elements are: Chunk, Anchor and Phrase
addAll()method 
public function addAll(collection:IIterable):Boolean

Parameters

collection:IIterable

Returns
Boolean
addChunk()method 
protected function addChunk(chunk:Chunk):Boolean

Adds a Chunk.

This method is a hack to solve a problem I had with phrases that were split between chunks in the wrong place.

Parameters

chunk:Chunk — a Chunk to add to the Phrase

Returns
Boolean — true if adding the Chunk succeeded
addSpecial()method 
pdf_core function addSpecial(o:Object):void

Parameters

o:Object

fromChunk()method 
public static function fromChunk(chunk:Chunk):Phrase

Parameters

chunk:Chunk

Returns
Phrase
getChunks()method 
public function getChunks():Vector.<Object>

Returns
Vector.<Object>
getValue()method 
public function getValue(index:int):Object

Parameters

index:int

Returns
Object
initFromChunk()method 
public function initFromChunk(chunk:Chunk):void

Parameters

chunk:Chunk

initFromPhrase()method 
public function initFromPhrase(phrase:Phrase):void

Parameters

phrase:Phrase

insert()method 
public function insert(index:int, o:Object):void

Parameters

index:int
 
o:Object

iterator()method 
public function iterator():Iterator

Returns
Iterator
process()method 
public function process(listener:IElementListener):Boolean

Parameters

listener:IElementListener

Returns
Boolean
push()method 
public function push(o:Object):Boolean

Parameters

o:Object

Returns
Boolean
toString()method 
public function toString():String

Returns
String
Constant Detail
DEFAULT_LEADINGConstant
public static const DEFAULT_LEADING:int = 16