CairoContext::showText

cairo_show_text

(PECL cairo >= 0.1.0)

CairoContext::showText -- cairo_show_textThe showText purpose

Description

Object oriented style (method):

public void CairoContext::showText ( string $text )

Procedural style:

void cairo_show_text ( CairoContext $context , string $text )

Description here.

Warning

This function is currently not documented; only its argument list is available.

Parameters

context

Description...

text

Description...

Return Values

Description...

Examples

Example #1 Object oriented style

<?php
/* ... */
?>

The above example will output something similar to:

...

Example #2 Procedural style

<?php
/* ... */
?>

The above example will output something similar to:

...

See Also

  • Classname::Method()

Коментарии

This is an example of the showText() method for drawing text on a surface. Note that selectFontFace() will select fonts that your OS recognizes and I didn't see a way in the current API to select a font by filename.

<?php
$surface 
= new CairoImageSurface(CAIRO_FORMAT_ARGB32960250);
$ctx = new CairoContext($surface);
$ctx->selectFontFace('EuropaGroNr2SH-XBolCon');
$ctx->setFontSize(30);
$ctx->setAntialias(1);
$ctx->moveTo(044);
$ctx->showText('Hello,');
$ctx->moveTo(3074);
$ctx->showText('world!');
$sName tempnam('/tmp','hello');
$surface->writeToPng($sName);
$data file_get_contents($sName);
unlink($sName);
header('Content-Type: image/png');
echo 
$data;
2010-02-11 00:14:57
http://php5.kiev.ua/manual/ru/cairocontext.showtext.html

    Поддержать сайт на родительском проекте КГБ