update : 2015.11.03
php.shukuma.com

검색:
 
 
The setFontFace purpose

CairoContext::setFontFace

cairo_set_font_face

(PECL cairo >= 0.1.0)

CairoContext::setFontFace -- cairo_set_font_faceThe setFontFace purpose

설명

객체 기반 형식 (method):

public void CairoContext::setFontFace ( CairoFontFace $fontface )

절차식 형식:

void cairo_set_font_face ( CairoContext $context , CairoFontFace $fontface )

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

예제

Example #1 객체 기반 형식

<?php
// New surface with white background
$s = new CairoImageSurface(CairoFormat::ARGB32300100);
$c = new CairoContext($s);
$c->setSourceRgb(111);
$c->paint();

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

Example #2 절차식 형식

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

참고