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="472VerifyingthattheTTFfontswork.html"><LINK REL="Next" HREF="474AddingadditionalfontstoJpGraph.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="472VerifyingthattheTTFfontswork.html">Previous</A><A HREF="474AddingadditionalfontstoJpGraph.html">Next</A><HR NOSHADE><H3><A NAME="4_7_3">4.7.3 Specifying fonts</A></H3><P> All graph objects that uses text allows you to specify the font tobe used by calling the SetFont() method and specifying three parameters</P><OL><LI> Font family, Specified with a FF_ define</LI><LI> Font style, Specified with a FS_ define</LI><LI> Font size, Numeric value (only used for TTF fonts)</LI></OL><P> For the builtin fonts the third, size, parameter is ignored sincethe size is fixed for the three builtin fonts. The available fontfamilies and the corresponding name (in JpGraph 1.7) are listed in thetable below.</P><P></P><TABLE border="1"><TR><TD>Font family</TD><TD>Type</TD><TD>Note</TD></TR><TR><TD>FF_FONT0</TD><TD>Builtin font</TD><TD>A very small font, onlyone style</TD></TR><TR><TD>FF_FONT1</TD><TD>Builtin font</TD><TD>A medium sized font</TD></TR><TR><TD>FF_FONT2</TD><TD>Builtin font</TD><TD>The largest bit mappedfont</TD></TR><TR><TD>FF_ARIAL</TD><TD>TTF font</TD><TD>Arial font</TD></TR><TR><TD>FF_VERDANA</TD><TD>TTF font</TD><TD>Verdana font</TD></TR><TR><TD>FF_COURIER</TD><TD>TTF font</TD><TD>Fix pitched courier</TD></TR><TR><TD>FF_BOOK</TD><TD>TTF font</TD><TD>Bookman</TD></TR><TR><TD>FF_COMIC</TD><TD>TTF font</TD><TD>Comic sans</TD></TR><TR><TD>FF_TIMES</TD><TD>TTF font</TD><TD>Times New Roman</TD></TR><TR><TD>FF_GEORGIA</TD><TD>TTF font</TD><TD>Georgia</TD></TR><TR><TD>FF_TREBUCHE</TD><TD>TTF font</TD><TD>Trebuche</TD></TR><TR><TD>FF_VERA</TD><TD>TTF font</TD><TD>Gnome Vera font, Available fromhttp://www.gnome.org/fonts/</TD></TR><TR><TD>FF_VERAMONO</TD><TD>TTF font</TD><TD>Gnome Vera Mono font,Available from http://www.gnome.org/fonts/</TD></TR><TR><TD>FF_VERASERIF</TD><TD>TTF font</TD><TD>Gnome Vera Serif font,Available from http://www.gnome.org/fonts/</TD></TR><TR><TD>FF_CHINESE</TD><TD>TTF font</TD><TD>Installed chinese font</TD></TR><TR><TD>FF_SIMSUN</TD><TD>TTF font</TD><TD>Installed chinese font</TD></TR><TR><TD>FF_BIG5</TD><TD>TTF font</TD><TD>Installed Chinese BIG5 font(needs iconv())</TD></TR></TABLE><P> Please note that not all font families support all styles. Thefigure below illustrates each of the available font families and whatstyles you may use.<DIV class="example"><BR> <A href="exframes/frame_listfontsex1.html" target="blank"><IMG border="0"HEIGHT="450" src="img/listfontsex1.png" WIDTH="550"></A><BR><B>Figure 1:</B> Illustration of some of the available fonts inJpGraph <A href="exframes/frame_listfontsex1.html" target="blank">[src]</A> <P></P></DIV></P><P></P><P> We finally show some example of valid font specifications<DIV class="phpscript"><CODE><FONT color="#000000"> <FONT color="#0000BB"> $graph</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">FF_FONT2</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">FF_FONT2</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">FS_BOLD</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">FF_ARIAL</FONT><FONT color="#007700">);<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONTcolor="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">FF_ARIAL</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">FS_BOLD</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">24</FONT><FONTcolor="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV></P><P></P><HR NOSHADE><A HREF="toc.html">Contents</A><A HREF="472VerifyingthattheTTFfontswork.html">Previous</A><A HREF="474AddingadditionalfontstoJpGraph.html">Next</A></BODY></HTML>