Packageindex Classtrees Modulegroups Elementlist Report XML Files

pc4p

pc4p_text

pc4p_object
  |
  +-- pc4p_text

private class pc4p_text extends pc4p_object

Provides text functionality

AuthorsAlexander Wirtz <alex@pc4p.net>
Version$Id: pc4p_text.html,v 1.20.2.1 2002/08/12 22:47:10 eru Exp $

 
Direct known subclasses: pc4p_pagenumber

Methods inherited from pc4p_object

pc4p_object, pc4p_calc_rot, pc4p_calc_rot_dim, pc4p_set_rot, pc4p_set_margin, pc4p_set_width, pc4p_set_textleading, pc4p_set_linecolor, pc4p_set_fillcolor, pc4p_make_objcopy, pc4p_draw_children

Public Method Summary

void pc4p_text(object pc4p_page &$parent)
pc4p_text constructor
void pc4p_set_weblink(string $weblink, [ string $style, integer $width, string $color ])
Sets a weblink for this object.
void pc4p_set_alignment([ string $alignment ])
Sets the alignment for the textWarning: documentation is missing.
void pc4p_set_font(string $fontname, [ integer $fontsize, string $encoding, integer $embed ])
Sets the font for this object.
void pc4p_set_text(string $text)
Sets the text which the object shall print later on
void pc4p_set_underline()
Shall the text have an underline?
void pc4p_set_rendering(integer $mode)
Changes the text-rendering
void pc4p_set_textcolor(string $textcolor)
Sets the color for this text.
object pc4p_text pc4p_split_text(integer $row)
Splits a text at a given row and returns the rest
void pc4p_draw()
Draw-function for the textWarning: documentation is missing.

Private Method Summary

integer pc4p_linefeed(string &$text)
Formats the text
integer pc4p_calc_alignment(string $text)
Calculates the text-alignment
int pc4p_calc_offset(object pc4p_page &$parent)
Calculates the dimensions for the textWarning: documentation is missing.

Fields inherited from pc4p_object

$children, $pdfp, $pdfobj, $pagewidth, $pageheight, $width, $height, $act_x, $act_y, $draw_x, $draw_y, $alignment, $phi, $leading, $linecolor, $fillcolor

Private Field Summary

array $margin
Margins for this text
array $weblink
Weblink for the object
integer $fontp
Fontpointer for this text
string $fontname
Fontname for this text
integer $fontsize
Fontsize for this text
integer $underline
Underline for this text
integer $rendering
Textrendering for this object
array $text
Text for this text...haha
array $textcolor
Textcolor

Public Method Details

pc4p_text

public void pc4p_text(object pc4p_page &$parent)

  Calls the constructor of pc4p_object and sets the textleading to the value of the parent...if it's not empty

Parameter
object pc4p_page &$parent
Parent of the text
Returns void

See Also pc4p_object::pc4p_object()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_weblink

public void pc4p_set_weblink(string $weblink, [ string $style, integer $width, string $color ])

  Add a weblink to this object, that will be opened on clicking on this object

Parameter
string $weblink
The URI of the weblink
string $style = >>""<<
The style of the border representing the weblink; "solid" or "dashed"
integer $width = >>-1<<
The width of the border representing the weblink; 0 represents an invisible border
string $color = >>""<<
The color of the border representing the weblink; you can use one of the 16 standardcolors from HTML or the hex-notation (#rrggbb)
Returns void

See Also pc4p_main::pc4p_check_color()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_alignment

public void pc4p_set_alignment([ string $alignment ])

  The same functionality as in every other document-software

Warning: documentation is missing.

Parameter
string $alignment = >>"left"<<
Valid values are "left", "center", "right" and "justify"
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_font

public void pc4p_set_font(string $fontname, [ integer $fontsize, string $encoding, integer $embed ])

  This is the function, with which you define everything concerning the font of your text.

Parameter
string $fontname
Name of your font
integer $fontsize = >>10<<
Size of the font...reasonable values please
string $encoding = >>"host"<<
You should leave this alone, until you know what you're doing
integer $embed = >>0<<
Triggers if the font will get embedded
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_text

public void pc4p_set_text(string $text)

  Do I really have to explain this function? I hope not...

Parameter
string $text
Accepts a string. Use \n for linefeeds.
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_underline

public void pc4p_set_underline()

  Call this function to enable underline for your text

Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_rendering

public void pc4p_set_rendering(integer $mode)

  Use this function, if you want to change the rendering-mode of this textobject

Parameter
integer $mode
We only support modes 0 to 3, as clipping paths make no sense here ( 0 => fill text, 1 => outline text, 2 => fill and outline, 3 => invisible text )
Returns void

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_set_textcolor

public void pc4p_set_textcolor(string $textcolor)

  You can define a textcolor here or reset the fillcolor to default, if you don't give a parameter

Parameter
string $textcolor
You can use one of the 16 standardcolors from HTML or the hex-notation (#rrggbb)
Returns void

See Also pc4p_main::pc4p_check_color()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_split_text

public object pc4p_text pc4p_split_text(integer $row)

  Very important function for pagebreak

Parameter
integer $row
Row, where the table shall be split
Returns object pc4p_text $split

Rest of the text, including the row you specified

See Also pc4p_object::pc4p_make_objcopy()
Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_draw

public void pc4p_draw()

  Draws the text for the set fontoptions and the calculated linefeeds

Warning: documentation is missing.

Returns void

See Also pc4p_text::pc4p_calc_alignment()
Author(s) Alexander Wirtz <alex@pc4p.net>

Private Method Details

pc4p_linefeed

private integer pc4p_linefeed(string &$text)

  This function formats the text for the actual width. Returns the rows which the text needs.

Parameter
string &$text
Text, which shall be linewrapped
Returns integer $lines

That many lines are needed for the input-string

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_calc_alignment

private integer pc4p_calc_alignment(string $text)

  The position of the text according to the set alignment is calculated.

Parameter
string $text
The text...no further explanation needed
Returns integer $draw_x

The position according to the alignment

Author(s) Alexander Wirtz <alex@pc4p.net>

pc4p_calc_offset

private int pc4p_calc_offset(object pc4p_page &$parent)

  Calculates the stringwidth for the current text and font in the object and applies linefeed where necessary. Returns the size for the complete object.

Warning: documentation is missing.

Parameter
object pc4p_page &$parent
Parent of the text
Returns int $this

->height Calculated height of the text

See Also pc4p_text::pc4p_linefeed()
Author(s) Alexander Wirtz <alex@pc4p.net>

Private Field Details

$margin

private array $margin

>>array( "top" => 0, "bottom" => 0, "left" => 0, "right" => 0 )<<


$weblink

private array $weblink

>>array( "URI" => "", "style" => "solid", "width" => 1, "color" => array( 0, 0, 0 ) )<<


$fontp

private integer $fontp

>><<


$fontname

private string $fontname

>>"Times-Roman"<<


$fontsize

private integer $fontsize

>>10<<


$underline

private integer $underline

>><<


$rendering

private integer $rendering

>><<


$text

private array $text

>><<


$textcolor

private array $textcolor

>>array( 0, 0, 0 )<<



Packageindex Classtrees Modulegroups Elementlist Report XML Files
Generated on Tue, 13 Aug 2002 00:43:10 +0200 by PHPDoc v1.5 www.phpdoc.de