PHP Doku:: The setFontFace purpose - cairocontext.setfontface.html

Verlauf / Chronik / History: (9) anzeigen

Sie sind hier:
Doku-Startseite ≥ PHP-Handbuch ≥ Funktionsreferenz ≥ Bildverarbeitung und -generierung ≥ Cairo ≥ The CairoContext class ≥ CairoContext::setFontFace -- cairo_set_font_face

Ein Service von Reinhard Neidl - Webprogrammierung.

The CairoContext class

<<CairoContext::setFillRule -- cairo_set_fill_rule

CairoContext::setFontMatrix -- cairo_set_font_matrix>>

CairoContext::setFontFace

cairo_set_font_face

(PECL cairo >= 0.1.0)

CairoContext::setFontFace -- cairo_set_font_face — The setFontFace purpose

Beschreibung

Object oriented style (method):

public void CairoContext::setFontFace ( CairoFontFace $fontface )

Procedural style:

void cairo_set_font_face ( CairoContext $context , CairoFontFace $fontface )

Sets the font-face for a given context.

Parameter-Liste

context

A CairoContext object to change the font-face for.

fontface

A CairoFontFace object

Rückgabewerte

No value is returned

Beispiele

Beispiel #1 Object oriented style

<?php
// New surface with white background
$s = new CairoImageSurface(CairoFormat::ARGB32, 300, 100);
$c = new CairoContext($s);
$c->setSourceRgb(1, 1, 1);
$c->paint();

// Draw some text
$c->setSourceRgb(0, 0, 0);
$c->moveTo(10, 60);
// Create a new font face
$f = new CairoToyFontFace("sans-serif", CairoFontSlant::NORMAL, CairoFontWeight::NORMAL);
$c->setFontFace($f);
$c->setFontSize(30);
$c->showText('Hello, World!');
$s->writeToPng(dirname(__FILE__) . '/setFontFace.png');
?>

Beispiel #2 Procedural style

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

Siehe auch


Keine BenutzerBeiträge.
- Beiträge aktualisieren...



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)