Class TextColumn
A column of paragraphs, each a list of TextLine objects that can differ in font, size and color, aligned left, right, center or justified, with a line spacing, a paragraph spacing and an optional line between the paragraphs. It draws all of its paragraphs where it is placed, top down; to rotate a column, add it to a Container and rotate that.
Use a TextColumn for an article or a page of mixed text: bold or colored words in a paragraph, justified paragraphs, CJK paragraphs. Use a TextBlock for one run of text in one font, and a TextFrame when the text must continue from one frame to the next, across columns or pages. Please see Example_12, Example_22, Example_13 and Example_16.
public class TextColumn : IDrawable
- Inheritance
-
TextColumn
- Implements
- Inherited Members
Constructors
TextColumn()
Create a text column object.
public TextColumn()
Methods
AddCJKParagraph(Font, string)
Adds a paragraph of Chinese, Japanese or Korean text to this text column, wrapped at any character to the width of the column.
public TextColumn AddCJKParagraph(Font font, string text)
Parameters
Returns
AddCJKParagraph(Font, string, string)
Adds a paragraph of Chinese, Japanese or Korean text to this text column, wrapped at any character to the width of the column, in the language given, which a screen reader reads it in.
public TextColumn AddCJKParagraph(Font font, string text, string language)
Parameters
fontFontthe font used by this paragraph.
textstringthe text.
languagestringthe language of the text, for example "zh-Hans", "ja" or "ko".
Returns
AddParagraph(Paragraph)
Adds a new paragraph to this text column.
public TextColumn AddParagraph(Paragraph paragraph)
Parameters
paragraphParagraphthe new paragraph object.
Returns
- TextColumn
this TextColumn object.
DrawOn(Page)
Draws this text column on the specified page. With no page nothing is drawn and the location of the next component is computed.
public float[] DrawOn(Page page)
Parameters
pagePagethe page to draw this text column on.
Returns
- float[]
the x and y coordinates of the bottom right corner of this text column.
GetHeight()
Returns the height of this text column.
public float GetHeight()
Returns
GetSize()
Returns dimension object containing the width and height of this component. Please see Example_22.
public Dimension GetSize()
Returns
- Dimension
dimension object containing the width and height of this component.
GetWidth()
Returns the width of this text column.
public float GetWidth()
Returns
RemoveLastParagraph()
Removes the last paragraph added to this text column.
public TextColumn RemoveLastParagraph()
Returns
SetHeight(float)
Sets the height of this text column.
public TextColumn SetHeight(float h)
Parameters
hfloat
Returns
SetLineBetweenParagraphs(bool)
Sets the lineBetweenParagraphs private variable value. If the value is set to true - an empty line will be inserted between the current and next paragraphs.
public TextColumn SetLineBetweenParagraphs(bool lineBetweenParagraphs)
Parameters
lineBetweenParagraphsboolthe specified bool value.
Returns
- TextColumn
this TextColumn object.
SetLineSpacing(float)
Sets the spacing between the lines in this text column.
public TextColumn SetLineSpacing(float lineSpacing)
Parameters
lineSpacingfloat
Returns
SetLocation(float, float)
Sets the location of this text column on the page.
public TextColumn SetLocation(float x, float y)
Parameters
Returns
SetParagraphSpacing(float)
Sets the space between paragraphs.
public TextColumn SetParagraphSpacing(float paragraphSpacing)
Parameters
paragraphSpacingfloat
Returns
SetTextAlignment(Alignment)
Sets the text alignment.
public TextColumn SetTextAlignment(Alignment alignment)
Parameters
alignmentAlignmentthe specified alignment code. Supported values: Alignment.LEFT, Alignment.RIGHT, Alignment.CENTER and Alignment.JUSTIFY
Returns
- TextColumn
this TextColumn object.
SetWidth(float)
Sets the desired width of this text column.
public TextColumn SetWidth(float w)
Parameters
wfloatthe width of this text column.
Returns
- TextColumn
this TextColumn object.