The setFontFace purpose

# CairoContext::setFontFace

# cairo_set_font_face

(PECL cairo >= 0.1.0)

CairoContext::setFontFace -- cairo_set_font_face — The setFontFace purpose

### 説明

オブジェクト指向型 (method):

public CairoContext::setFontFace ( CairoFontFace `$fontface` ) : void

手続き型:

cairo_set_font_face ( CairoContext `$context` , CairoFontFace `$fontface` ) : void

Sets the font-face for a given context.

### パラメータ

`context`

  A CairoContext object to change the font-face for.

`fontface`

  A CairoFontFace object

### 返り値

No value is returned

### 例

例1 オブジェクト指向型

`<?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');
?>`

例2 手続き型

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

### 参考

- CairoContext::setFontSize() - The setFontSize purpose
- CairoContext::showText() - The showText purpose