Contents
Login Register Wishes Forum About
Language Reference » Settings functions » setFontProperties
Help topics
Latest updates
2208d  replaceImageMapTitle
2208d  replaceImageMapValues
2208d  createFunctionSerie
2208d  setAbsicssaPosition
2208d  negateValues
Toolbox
  Download as PDF
  Print this page
  Share this page
  Create an account
  Feed the updates!
Google AdSense
setFontProperties - Set default fonts properties

This function allows you to specify the default settings for all text outputs on yout pictures. As you‘ll notice, some functions can override this default settings but if not explicitely specified, default settings will be used. Parameters are given trough a $Format array. To learn more about this please read the Format array guide.

Calling this function
setFontProperties($Format="");
Where :

Format is an array containing the drawing parameters of the arrow.


Customisation array - Tune up your texts!

It is possible to customize the fonts rendering by playing with this array. Providing a detailled configuration is not mandatory, by default the texts will be written in black with the "GeosansLight.ttf" font file.

The font name can be set with FontName.
The font size can be set with FontSize.
The font color can be set with R, G, B.
The alpha transparency factor can be set with Alpha.


Sample script



 /* Enable shadow support */
 $myPicture->setShadow(TRUE,array("X"=>2,"Y"=>2,"R"=>0,"G"=>0,"B"=>0,"Alpha"=>20);

 /* Force the font properties and color */
 $myPicture->setFontProperties(array("FontName"=>"fonts/MankSans.ttf","FontSize"=>30,"R"=>231,"G"=>50,"B"=>36));
 $myPicture->drawText(340,90,"Some big red text");

 /* Force the font properties and color */
 $myPicture->setFontProperties(array("FontName"=>"fonts/Silkscreen.ttf","FontSize"=>6,"R"=>29,"G"=>70,"B"=>111));
 $myPicture->drawText(340,100,"Some blue text");

This will write some text areas while forcing the font file name & color with the setFontProperties() function.
Last updated on 10/21/2009 
by Jean-Damien 
Linked resources
Community comments
  No comments have been posted yet.
© Copyrights
Components used on this web site : Famfamfam icons has been made by Mark James, Rounded corners lite has been coded by Cameron Cooke and Tim Hutchison, SyntaxHighlighter has been written by Alex Gorbatchev. pChart and this web site have been created by Jean-Damien POGOLOTTI. This documentation contains 185 pages and 56 comments. 409 users have registered. This page has been rendered in 0,01 seconds. Wiki revision 1.37.