[cairo] font face in cairo-wrapper for php

Behdad Esfahbod behdad at behdad.org
Wed Mar 18 18:20:50 PDT 2009

On 03/18/2009 09:17 PM, Fan Zhang wrote:
> Thanks,
> How do I get the font family name on my system?

If you want to select a specific font, use its name.  Otherwise just use the 
empty string and it will select the default font for you.

> Python wrapper has this
> creat_cairo_font_face_for_file building.

Humm.  There is no such symbol in cairo.  Where did you find that?


> Why is PHP support so badly.
> Behdad Esfahbod wrote:
>> On 03/18/2009 05:28 AM, Fan Zhang wrote:
>>> Hi,
>>> Does anyone know how to use
>>> void *cairo_select_font_face* ( resource cr, string fontname, int slant,
>>> int weight )
>>> for loading local fonts?
>>> i've tried to do
>>> cairo_select_font_face ($this->cr, arialbold.ttf,
>>> and arialbold.ttf is in the same path of the php file, but it won't
>>> work.
>>> If cairo-wrapper only use the system font, where can i add new fonts?
>>> I'm using fedora and cairo is installed from YUM.
>> The PHP binding has the wrong parameter name. The fontname parameter
>> is actually a family name. That is, a string like "Arial", or "DejaVu
>> Sans". If you want to use a font file, you'd need to use either
>> fontconfig or freetype API directly to create a FcPattern or FT_Face
>> and use the API in cairo-ft.h to use those with cairo. Not sure if
>> those are bound in the PHP bindings.
>> behdad
>>> Thanks

More information about the cairo mailing list