gdk::font_load

GdkFont gdk::font_load (string font_name);

Este método carga un nombre de fuente, el cual debe ser dado de la forma X Logical Font Description (XLFD).

XLFD es una forma de describir una fuente que es competamente independiente del sistema. Contiene 14 campos, la mayoria de los cuales pueden representar con un comodin * para permitir flexibilidad cuando se hace una busqueda - las excepciones son addedstyle, que no necesita, y registry, que es un campo obligatorio. La descripción comienza con un guión, -, y cada campo es también separado por un guión.

Si necesitas mas información sobre fuentes que el dado aquí, la completa definición esta disponible en linea a traves de XWindows documentation.

foundry xxx (where the font was created. 'unknown' is okay)
family xxx (e.g. Arial)
weight xxx (e.g. bold, medium)
slant x (r - roman, i = italic, o = oblique)
setwidth xxx (e.g. normal, condensed)
addedstyle xxx (e.g. serif, sans. Leave blank for none)
pixelsize N (set either this or pointsize, not both)
pointsize N (point size, e.g. 120)
resx N (x res the font was created for, in dots per inch)
resy N (y res the font was created for, in dots per inch)
space x (m = monospaced, p = proportional, c = cell)
averagewidth N (average character width in pixels. 0 if unknown)
registry xxx (e.g. utf, iso8859 or adobe)
encoding xxx (e.g. 1 or 2 (for iso8859) or fontspecific)

Una carga de fuente tipica seria algo asi: $font = gdk::font_load('-unknown-Arial-normal-r-normal--*-120-96-96-p-0-iso8859-1');

Información de las fuente en el formato XLFD pueden ser vistas en cualquier sistema que utilice los widgets GtkFontSelection o GtkFontSelectionDialog.

Note that there are sizing issues in GdkFont in the version of GTK+ currently used in PHP-GTK under win32. As a result, the point size should always be set in win32 - using the pixel size may give unexpected results.