CLASS TextProperty (Defined in: jpgraph_gantt.php : 1504)

TextProperty
Align() Set() SetAlign() SetColor() SetFont() Show()

Class usage and Overview
This is very similair to Text but this is only used as an internal helper class in Gantt chart. In comparison with text it has the added funtionality that it can handle tabs. In the next version of JpGraph the extra functionality that this class has should be added to the real class Text() to make the class more orthogonal. Since this is just an internal helper class it has its justified position though. This was oroginally considered a very experimental text class and it made sence to compartmetn thath functionlity in a separate class to the stnadard Text() class.

See also related classes:
Text

Class Methods

function Align($aHAlign,$aVAlign)
Specify vertical and horizontal alignment

Argument | Default | Description
--- | --- | ---
$aHAlign |  | Horizontal alignment
$aVAlign | "bottom" | Vertical alignment

Description
Specify the anchor point fo the text. The anchor point determines how the texts x,y positions should be interpretated.

function Set($aTxt)
Specify text string

Argument | Default | Description
--- | --- | ---
$aTxt |  | Text string

Description
Specify text string

Example

$graph->title->Set("Overview for year 2002");

function SetAlign($aHAlign,$aVAlign)
Specify alignment for text

Argument | Default | Description
--- | --- | ---
$aHAlign |  | Horizontal alignment
$aVAlign | "bottom" | Vertical alignment

Description
Specify alignment for text. Same as TextProperty::Align()
See also
TextProperty::Align

function SetColor($aColor)
Set text color

Argument | Default | Description
--- | --- | ---
$aColor |  | Color

Description
Specify text color

Example

SetColor('red:0.6');

function SetFont($aFFamily,$aFStyle,$aFSize)
Specify font

Argument | Default | Description
--- | --- | ---
$aFFamily |  | Font family
$aFStyle | FS_NORMAL | Font style
$aFSize | 10 | Font size

Description
Specify font family, size and style. Two major types of font families can be used, builtin bitmnapped fonts or TTF fonts. The builtin fonts have a fixed size which can't be altered. Valid styles are

- FS_NORMAL
- FS_BOLD
- FS_ITALIC
- FS_BOLDITALIC

Valid values for the internal font families are

- FF_FONT0, Internal font 1 (small font)
- FF_FONT1, Internal font 2, (Medium size)
- FF_FONT2, Internal font 3, (large size)

Note: FF_FONT0 only suppor font style FS_NORMAL The available TTF are by default

- FF_ARIAL
- FF_TIMES, (Times Roman)
- FF_COURIER, (Courier new)
- FF_VERDANA, (Verdana)
- FF_BOOK, (Bookman)
- FF_HANDWRT, (Handwriting)
- FF_COMIC, (Sans Comic)

See also
Image::StrokeText

Example

SetFont(FF_ARIAL,FS_NORMAL,12)

function Show($aShow)
Unhide/hide the text

Argument | Default | Description
--- | --- | ---
$aShow | true | True=Show text

Description
Specify if the text should be displayed or hidden