OxyScripts.com
Menu spacer Home Tutorials Articles Code Forums irc.freenode.net #oxyscripts
Main (PHP)
Home Forums PHP News PHP Tutorials Articles PHP Code Snippets Contact Us Sysadmin Resources Books Template Shop
3rd Party Streams
SlashDot PHPDeveloper.org PHP.Net
Resources
PHP Manual MySQL Manual Smarty Manual PEAR Manual PHP-GTK Manual Symfony Manual
Code Snippets
Authentication Database Graphics HTTP Miscellaneous Time/Date
Affiliates
Scripts TutorialMan TutorialGuide CodingForums.com PHP Scripts Cheap Web Hosting Affordable Web Hosting Dreamweaver Templates

Search This Site :     PHP Function Reference :
 
gdk::font_load

gdk::font_load

GdkFont gdk::font_load (string font_name);

This method loads a font_name, which must be given in the form of an X Logical Font Description (XLFD).

The XLFD is a way of describing a font that is completely system-independant. It contains 14 fields, most of which can be represented by a wildcard * in order to allow flexibility when a match is being sought - the exceptions are addedstyle, which doesn't need one, and registry, which is the only mandatory field. The description opens with a hyphen, -, and each field is also separated by a hyphen.

If you need more information on fonts than is given here, the full XWindows definition is available online through the relevant 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)

A typical font-load would look something like this: $font = gdk::font_load('-unknown-Arial-normal-r-normal--*-120-96-96-p-0-iso8859-1');

Font information in the XLFD format can be retrieved from any system by utilising the GtkFontSelection or GtkFontSelectionDialog widgets.

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.

 
   Print this page

Top Sponsor
Symantec\'s Norton SystemWorks 2006
Sponsors
CA
Sponsors
AdWords Dominator 125*125
Advertisting

Affiliates
VertexTemplates PHPFreaks CodeWalkers StarGeek DevScripts CGI & PHP Scripts PHP CMS

Shopping Rebates   Sell It 4 You   Flash Page Counters   Get Insured
GPS Tracking Service   Charity Donate Info   Web Site Hosting   VOIP Service

Privacy Policy | Links | Site Map | Advertising

All content on OxyScripts.com is (©)2002-2007

 
Powered by Adrastea - Version 1.0.0. Copyright © Rune Solutions, 2004-2005