com.snowtide.pdf.layout
Interface TextUnit

All Superinterfaces:
Region

public interface TextUnit
extends Region

A single character or discrete character grouping positioned within a Line. Note that space characters are typically not encoded in PDF documents; rather, they are implicit in the spacing between the bounding boxes of adjacent TextUnits.

Since:
v1.4
Version:
©2004-2008 Snowtide Informatics Systems, Inc.

Method Summary
 char[] getCharacterSequence()
          Returns a character array indicating the characters that should be rendered for this TextUnit instead of the 'raw' character code provided by getCharCode().
 int getCharCode()
          Returns the 'raw' character code used to encode this TextUnit in the source PDF document.
 Font getFont()
          Returns the Font that was in force when this textunit was outputted.
 float getTheta()
          Returns the angle (in degrees) by which this TextUnit's baseline is rotated.
 boolean isUnderlined()
          Returns true if this TextUnit is underlined.
 
Methods inherited from interface com.snowtide.pdf.layout.Region
area, endxpos, endypos, height, width, xpos, ypos
 

Method Detail

getCharCode

public int getCharCode()
Returns the 'raw' character code used to encode this TextUnit in the source PDF document. In many cases, this character code is equivalent to the Unicode character id. Otherwise, the font and encoding information in force when the character code was read from the PDF document dictates that a particular character sequence be rendered instead of the Unicode character corresponding to the character code returned by this function.


getCharacterSequence

public char[] getCharacterSequence()
Returns a character array indicating the characters that should be rendered for this TextUnit instead of the 'raw' character code provided by getCharCode(). This function may return null, in which case the Unicode character corresponding with the 'raw' character code should be used when rendering this TextUnit.


getFont

public Font getFont()
Returns the Font that was in force when this textunit was outputted.


isUnderlined

public boolean isUnderlined()
Returns true if this TextUnit is underlined. While this will report an appropriate value for text that is rotated by a "regular" angle (90º, -90º, 180º), it will always return false for text that is rotated by any other angle (i.e. 30º, -45º, 16º, etc).


getTheta

public float getTheta()
Returns the angle (in degrees) by which this TextUnit's baseline is rotated.