Blame | Letzte Änderung | Log anzeigen | RSS feed
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd"><HTML><HEAD><META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1"><LINK REL="Start" HREF="index.html"><LINK REL="Contents" HREF="toc.html"><LINK REL="Prev" HREF="1221AdjustingthesizeoftheLEDdigits.html"><STYLE TYPE="text/css"><!--BODY { font-family: serif }H1 { font-family: sans-serif }H2 { font-family: sans-serif }H3 { font-family: sans-serif }H4 { font-family: sans-serif }H5 { font-family: sans-serif }H6 { font-family: sans-serif }SUB { font-size: smaller }SUP { font-size: smaller }PRE { font-family: monospace }A { text-decoration: none }--></STYLE></HEAD><BODY><A HREF="toc.html">Contents</A><A HREF="1221AdjustingthesizeoftheLEDdigits.html">Previous</A><HR NOSHADE><H1><A NAME="13">13 Code defines in JpGraph</A></H1><P> Various settings in JpGraph are controlled by overall DEFINEs in theconfiguration file "jpg-config.inc.php". Most of these defines havedefault values that should be valid for most usage.</P><P> In the rest of this chapter all constants are described with defaultvalue and usage.</P><P></P><TABLE cellpadding="3" cellspacing="0" class="codedefines"><TR><TH>Define, default value</TH><TH>Comment</TH></TR><TR><TD valign="top">"CACHE_DIR", "/tmp/jpgraph_cache/"</TD><TD>The fullabsolute name of directory to be used as a cache. This directory<STRONG>must</STRONG> be readable and writable for PHP. Must end with '/'</TD></TR><TR><TD valign="top">"TTF_DIR", "/usr/local/fonts/ttf/"</TD><TD>Directory for JpGraph TTF fonts. Must end with '/' The fonts must followthe naming conventions as used by the supplied TTF fonts in JpGraph.</TD></TR><TR><TD valign="top">"CSIMCACHE_DIR", "csimcache/"</TD><TD>Directory forcache directory for CSIM graphs. Must end with '/' Cache directoryspecification for use with CSIM graphs that are using the cache. Thedirectory must be the filesystem name as seen by PHP and the 'http'version must be the same directory but as seen by the HTTP serverrelative to the 'htdocs' directory. If a relative path is specified itis taken to be relative from where the image script is executed. Note:The default setting is to create a subdirectory in the directory fromwhere the image script is executed and store all files there. As usualthis directory must be writable by the PHP process.</TD></TR><TR><TD valign="top">"CSIMCACHE_HTTP_DIR", "csimcache"</TD><TD>Directoryfor JpGraph TTF fonts. Must end with '/' Cache directory specificationfor use with CSIM graphs that are using the cache. The directory mustbe the filesystem name as seen by PHP and the 'http' version must bethe same directory but as seen by the HTTP server relative to the'htdocs' directory. If a relative path is specified it is taken to berelative from where the image script is executed. Note: The defaultsetting is to create a subdirectory in the directory from where theimage script is executed and store all files there. As usual thisdirectory must be writable by the PHP process.</TD></TR><TR><TD valign="top">"CHINESE_TTF_FONT", "bkai00mp.ttf"</TD><TD> Actualname of the TTF file used together with FF_CHINESE aka FF_BIG5 This isthe TTF file being used when the font family is specified as eitherFF_CHINESE or FF_BIG5</TD></TR><TR><TD valign="top">"LANGUAGE_CYRILLIC", false</TD><TD> Special unicodeCyrillic language support.</TD></TR><TR><TD valign="top">"CYRILLIC_FROM_WINDOWS", false</TD><TD> If you aresetting this config to true the conversion will assume that the inputtext is windows 1251, if false it will assume koi8-r</TD></TR><TR><TD valign="top">'MINCHO_TTF_FONT', 'ipam.ttf'</TD><TD> JapaneseTrueType font used with FF_MINCHO</TD></TR><TR><TD valign="top">'PMINCHO_TTF_FONT', 'ipamp.ttf'</TD><TD> JapaneseTrueType font used with FF_PMINCHO</TD></TR><TR><TD valign="top">'GOTHIC_TTF_FONT', 'ipag.ttf'</TD><TD> JapaneseTrueType font used with FF_GOTHIC</TD></TR><TR><TD valign="top">'PGOTHIC_TTF_FONT', 'ipagp.ttf'</TD><TD> JapaneseTrueType font used with FF_PGOTHIC</TD></TR><TR><TD valign="top">"INSTALL_PHP_ERR_HANDLER", false</TD><TD> Determineif the library should also setup the default PHP error handler togenerate a graphic error message. This is useful during development tobe able to see the error message as an image instead as a "red-cross"in a page where an image is expected.</TD></TR><TR><TD valign="top">"CATCH_PHPERRMSG", true</TD><TD> Should the libraryexamine the global php_errmsg string and convert any error in it to agraphical representation. This is handy for the occasions when, forexample, header files cannot be found and this results in the graph notbeing created and just a "red-cross" image would be seen. This shouldbe turned off for a production site.</TD></TR><TR><TD valign="top">"USE_LIBRARY_GD2",false</TD><TD>Specify if weshould use GD 2.x or GD 1.x If you have GD 2.x installed it isrecommended that you use it since it will give a slightly, slightlybetter visual appearance for arcs. If you don't have GD2 installed thismust be set to false!</TD></TR><TR><TD valign="top">'USE_TRUECOLOR',true</TD><TD>Should the image be atruecolor image? Note 1: Can only be used with GD 2.0.2 and above. Note2: GD 2.0.1 + PHP 4.0.6 on Win32 crashes when trying to use truecolor.Truecolor support is to be considered alpha since GD 2.x is still notconsidered stable (especially on Win32). Note 3: MUST be enabled to getbackground images working with GD2 Note 4: If enabled then truetypefonts will look very ugly => You can't have both background images andtruetype fonts in the same image until these bugs has been fixed in GD2.01</TD></TR><TR><TD valign="top">"USE_CACHE",false</TD><TD>Should the cache be usedat all? By setting this to false no files will be generated in thecache directory. The difference from READ_CACHE being that settingREAD_CACHE to false will still create the image in the cache directoryjust not use it. By setting USE_CACHE=false no files will even begenerated in the cache directory.</TD></TR><TR><TD valign="top">"READ_CACHE",true</TD><TD>Should we try to find animage in the cache before generating it? Set this define to false tobypass the reading of the cache and always regenerate the image. Notethat even if reading the cache is disabled the cached will still beupdated with the newly generated image. Set also "USE_CACHE" below.</TD></TR><TR><TD valign="top">"DEFAULT_GFORMAT","auto"</TD><TD>Default graphicformat set to "auto" which will automatically choose the best availableformat in the order png,gif,jpg (The supported format depends on whatyour PHP installation supports)</TD></TR><TR><TD valign="top">"USE_IMAGE_ERROR_HANDLER",true</TD><TD> Determineif the error handler should be image based or purely text based. Imagebased makes it easier since the script will always return an image evenin case of errors.</TD></TR><TR><TD valign="top">"USE_APPROX_COLORS",true</TD><TD>If the colorpalette is full should JpGraph try to allocate the closest match? Ifyou plan on using background image or gradient fills it might be a goodidea to enable this. If not you will otherwise get an error saying thatthe color palette is exhausted. The drawback of using approximations isthat the colors might not be exactly what you specified. Note1: Thisdoes only apply to a palette image, not true color images since theydon't have the limitations of maximum number of colors.</TD></TR><TR><TD valign="top">"ERR_DEPRECATED",false</TD><TD>Should usage ofdeprecated functions and parameters give a fatal error? (Useful tocheck if code is future proof.)</TD></TR><TR><TD valign="top">"BRAND_TIMING",false</TD><TD>Should the time takento generate each picture be branded to the lower left in corner in eachgenerated image? Useful for performance measurements generating graphs</TD></TR><TR><TD valign="top">"BRAND_TIME_FORMAT","Generated in: %01.3fs"</TD><TD>What format should be used for the timing string?</TD></TR></TABLE><P> The following defines should very rarely need to be changed</P><P></P><TABLE cellpadding="3" cellspacing="0" class="codedefines"><TR><TH>Define, default value</TH><TH>Comment</TH></TR><TR><TD valign="top">"CACHE_FILE_GROUP","wwwadmin"</TD><TD>What groupshould the cached file belong to (Set to "" will give the default groupfor the "PHP-user") Please note that the Apache user must be a memberof the specified group since otherwise it is impossible for Apache toset the specified group.</TD></TR><TR><TD valign="top">"CACHE_FILE_MOD",0664</TD><TD>What permissionsshould the cached file have (Set to "" will give the defaultpermissions for the "PHP-user")</TD></TR><TR><TD valign="top">"USE_BRESENHAM",false</TD><TD>Decide if we shoulduse the Bresenham circle algorithm or the built in Arc(). Bresenhamgives better visual appearance of circles but is more CPU intensive andslower then the built in Arc() function in GD. Turned off by defaultfor speed</TD></TR><TR><TD valign="top">"_CSIM_SPECIALFILE","_csim_special_"</TD><TD>Special file name to indicate that we only want to calc the image map inthe call to Graph::Stroke() used internally from the GetHTMLCSIM()method.</TD></TR><TR><TD valign="top">"_CSIM_DISPLAY","_jpg_csimd"</TD><TD>HTTP GETargument that is used with image map to indicate to the script to justgenerate the image and not the full CSIM HTML page.</TD></TR></TABLE> <P> </P><P>&nbsp</P></DIV><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="1221AdjustingthesizeoftheLEDdigits.html">Previous</A></BODY></HTML>