News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Michael Maclean's Blog:
Handling fonts in PECL/Cairo
March 02, 2010 @ 12:42:43

Michael Maclean has a look at working with fonts in Cairo (a graphics manipulation extension in the PECL repository). The example will be added to the PHP manual too in case you need it for reference later.

Currently, in PECL/Cairo the only way to draw text is the referred to as the "toy" text API, which is a very basic way of handling text compared to the facilities available in the Cairo library itself. However, it's sufficient for most purposes that I've come across so far.

With the first versions of the Cairo extension, you had to use the selectFontFace method to choose the font you wanted. With the introduction of Cairo 0.2.0, you can now use FreeType font support instead and can use the streams API built into PHP to locate the resource. A snippet of code is included to show how that would work.

0 comments voice your opinion now!
cairo graphic manipulation extension font freetype


blog comments powered by Disqus

Similar Posts

PHP-GTK Blog: How to: PHP 5.3 with PHP-GTK and Cairo on Linux Mint 9

Lorna Mitchell's Blog: Using Gearman from PHP

Pierre-Alain Joye's Blog: ext/filter, API frozen (!) and fixes, 0.11.0 is out

Abhinav Singh's Blog: PHP Extensions - How and Why?

Hasin Hayder's Blog: Using new PECL Memcached extension for storing session data


Community Events

Don't see your event here?
Let us know!


extension laravel5 threedevsandamaybe voicesoftheelephpant opinion development library series language laravel framework podcast wordpress release unittest interview api introduction feature community

All content copyright, 2015 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework