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

ZetaCode.com:
PHP GTK tutorial
Nov 18, 2011 @ 18:41:30

Jan Bodnar has pointed out a great PHP-GTK tutorial on ZetaCode.com that walks you through some of the major points of this graphical frontend for PHP:

This tutorial will teach you the basics of GUI programming with the PHP GTK. The tutorial has 8 chapters which cover the first steps with the library, menus, toolbars, dialogs and various widgets. It has some examples for drawing with Cairo library. The final chapter presents a small computer game; The Nibbles.

Each of the topics has sample code and screenshots of the resulting output for each. Also included is information on layouts and "painting" with Cairo - drawing shapes, rectangles, text, etc.

tagged: phpgtk graphical frontend tutorial widget cairo

Link:

Voices of the ElePHPant:
Interview with Michael Maclean
Jul 07, 2011 @ 13:56:10

The Voices of the ElePHPant podcast has release their latest episode today - an interview with Michael Maclean, a developer on the Cairo PHP project.

Cal asks Michael his "three questions" about his

  • Explain to us what Cairo PHP is and why PHP developers should be interested in it.
  • What is your role in the project and how did you get involved in such a unique project?
  • Give us some examples of some real-world projects that use Cairo PHP.

You can listen to this new episode either through the in-page player, by downloading the mp3 or by subscribing to their feed.

tagged: voice elephpant podcast interview community member michaelmaclean cairo

Link:

Michael Maclean's Blog:
Using Pango for PHP: a taster
Feb 22, 2011 @ 18:58:27

Michael Maclean has a new article today talking about the Pango graphics library and how it can be coupled with the Cairo PECL extension to more easily create better looking text in dynamic images.

The PECL/Cairo library is pretty good at drawing vector graphics (in our opinion, as the developers, at least!), but one thing it's not able to do by itself is draw text with mildly advanced layout. [...] That's because the developers of the Cairo library decided to let another more specialised library handle the job of text layout.

Michael has created a wrapper for Pango in PHP (github) and some sample code that can be used as a test to ensure it's all setup and working. He steps through each part of the image creation and describes what's happening and what each method is doing along the way.

tagged: pango image creation cairo text render tutorial

Link:

PHP-GTK Blog:
How to: PHP 5.3 with PHP-GTK and Cairo on Linux Mint 9
Aug 13, 2010 @ 14:33:23

On the PHP-GTK blog today there's a new post looking at getting the latest versions of PHP (5.3) and PHP-GTK up and running on a Ubuntu-based system.

At the moment there are some minor problems when trying to get a working installation of PHP with GTK running on Ubuntu based systems. Here is a quick walk through of how you can get this all set up with the trunks from GTK and Cairo and the official package for php-cli in 10 easy steps. This installation was originally done on Linux Mint 9 but should work with most Ubuntu based Linux distributions.

There's ten steps in the process including fetching the packages you'll need with an apt-get call, checking out the latest cairo and php-gtk and the commands to patch and build the source.

tagged: phpgtk cairo linux ubuntu tutorial install

Link:

Michael Maclean's Blog:
Handling fonts in PECL/Cairo
Mar 02, 2010 @ 18: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.

tagged: cairo graphic manipulation extension font freetype

Link:

Elizabeth Smith's Blog:
Cairo Alpha Released
Jul 10, 2009 @ 12:51:03

Elizabeth Smith has posted about the latest release of a PHP extension she's been working hard on - the Cairo 2D graphics extension.

The first alpha of the PECL Cairo extension I've been working on is finally out. Cairo is a 2D graphics library written in C with support for multiple output devices. The extension provides an Object Oriented API, but also includes procedural methods. This is similar to PHP's date and mysqli extensions

The extension (for PHP 5.2.x and 5.3.x versions) requires the CairoGraphics library to work but it allows you to create some great graphics and output them in a number of ways (like PDF, SVG and PostScript). The extension is still in the alpha stages because the API isn't quite complete, but you can still download this version if you'd like to give it a shot.

tagged: alpha extension graphics cairo

Link:

Matthew Turland's Blog:
Building PHP-GTK with Cairo Support on Ubuntu Jaunty
Apr 27, 2009 @ 15:28:06

Matthew Turland has posted a guide he created following his own process as he worked to compile PHP 5.3.0RC1 with PHP-GTK/Cairo support on a Ubuntu (Jaunty) installation.

The process was a bit arduous, as Ubuntu apparently has a rather "interesting" automake package, so I thought I'd document it here for anyone who might be interested in repeating the process. [...] I'm assuming here that you want to use as many available Ubuntu packages as is feasible, aside from maybe PHP itself, in order to minimize the amount of manual compilation necessary.

He works through the steps that include installing several packages (via apt-get), compiling PHP to work with PHP-GTK, compiling and phpize-ing the Cairo extension and including that into the php.ini for the local installation. There's even a quick test script (a clock) you can run to see if all it working correctly.

tagged: phpgtk cairo ubuntu jaunty php5 install package tutorial

Link:

Elizabeth Smith's Blog:
New Cairo Symbols in 1.8 and 1.6
Oct 14, 2008 @ 14:32:10

Elizabeth Smith has worked up a post with a full listing of the new symbols in the Cairo extension (a 2D graphics library for PHP).

Originally we were only going to support the latest (1.6), but then the new 1.8 version was released and I started adding support to that as well. Then we noticed that dreadfully slow/out of date RHEL and derivatives still have 1.4 versions of Cairo floating around (yuck). So the extension will support 1.4+ However the cairo docs are incorrect in a couple of places regarding new symbols. After some header diffing here is a complete list for 1.8 and 1.6 (to make life easier for anyone else writing language wrappers).

Her list includes forty new symbols for the 1.8 release of the extension and twenty-two for version 1.6.

tagged: cairo graphic library 2d extension pecl

Link:

PHP.net:
Google Summer of Code: php.net students
Apr 23, 2008 @ 12:58:21

The main PHP.net website has posted a list of people participating in this year's Google Summer of Code project on various PHP projects. These include:

You can check out more information on the projects (including links to their individual pages) on this page of the Google Code website.

tagged: phpnet gsoc2008 students optimizer xdebug cairo pecl unicode php6

Link:

Kore Nordmann's Blog:
Comparision of PHP image libraries
Dec 13, 2007 @ 18:07:00

Kore Nordmann has written up some benchmarks of some of the more popular PHP image creation libraries testing their output times and results for generating the same image.

In my article series I showed several ways on how to create images with PHP, going into implementation details etc. Now I just want to provide a very rough overview on speed and quality of the extensions.

He ran them with some settings disabled to optimize things as they ran and came up with results pointing to Cairo being the fastest to generate and output the image. It also had the benefit of outputting an image with the highest quality of the five tested (Cairo, SVG, Flash and GD with and without supersampling). His benchmark code is also included.

tagged: compare benchmark image library cairo svg flash gd compare benchmark image library cairo svg flash gd

Link:


Trending Topics: