| 1 |
lars |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
|
|
|
2 |
<HTML>
|
|
|
3 |
<HEAD>
|
|
|
4 |
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=iso-iso-8859-1">
|
|
|
5 |
<LINK REL="Start" HREF="index.html">
|
|
|
6 |
<LINK REL="Contents" HREF="toc.html">
|
|
|
7 |
<LINK REL="Prev" HREF="472VerifyingthattheTTFfontswork.html">
|
|
|
8 |
<LINK REL="Next" HREF="474AddingadditionalfontstoJpGraph.html">
|
|
|
9 |
<STYLE TYPE="text/css"><!--
|
|
|
10 |
BODY { font-family: serif }
|
|
|
11 |
H1 { font-family: sans-serif }
|
|
|
12 |
H2 { font-family: sans-serif }
|
|
|
13 |
H3 { font-family: sans-serif }
|
|
|
14 |
H4 { font-family: sans-serif }
|
|
|
15 |
H5 { font-family: sans-serif }
|
|
|
16 |
H6 { font-family: sans-serif }
|
|
|
17 |
SUB { font-size: smaller }
|
|
|
18 |
SUP { font-size: smaller }
|
|
|
19 |
PRE { font-family: monospace }
|
|
|
20 |
A { text-decoration: none }
|
|
|
21 |
--></STYLE>
|
|
|
22 |
</HEAD>
|
|
|
23 |
<BODY>
|
|
|
24 |
<A HREF="toc.html">Contents</A>
|
|
|
25 |
<A HREF="472VerifyingthattheTTFfontswork.html">Previous</A>
|
|
|
26 |
<A HREF="474AddingadditionalfontstoJpGraph.html">Next</A>
|
|
|
27 |
<HR NOSHADE>
|
|
|
28 |
<H3><A NAME="4_7_3">4.7.3 Specifying fonts</A></H3>
|
|
|
29 |
<P> All graph objects that uses text allows you to specify the font to
|
|
|
30 |
be used by calling the SetFont() method and specifying three parameters</P>
|
|
|
31 |
<OL>
|
|
|
32 |
<LI> Font family, Specified with a FF_ define</LI>
|
|
|
33 |
<LI> Font style, Specified with a FS_ define</LI>
|
|
|
34 |
<LI> Font size, Numeric value (only used for TTF fonts)</LI>
|
|
|
35 |
</OL>
|
|
|
36 |
<P> For the builtin fonts the third, size, parameter is ignored since
|
|
|
37 |
the size is fixed for the three builtin fonts. The available font
|
|
|
38 |
families and the corresponding name (in JpGraph 1.7) are listed in the
|
|
|
39 |
table below.</P>
|
|
|
40 |
<P></P>
|
|
|
41 |
<TABLE border="1">
|
|
|
42 |
<TR><TD>Font family</TD><TD>Type</TD><TD>Note</TD></TR>
|
|
|
43 |
<TR><TD>FF_FONT0</TD><TD>Builtin font</TD><TD>A very small font, only
|
|
|
44 |
one style</TD></TR>
|
|
|
45 |
<TR><TD>FF_FONT1</TD><TD>Builtin font</TD><TD>A medium sized font</TD></TR>
|
|
|
46 |
<TR><TD>FF_FONT2</TD><TD>Builtin font</TD><TD>The largest bit mapped
|
|
|
47 |
font</TD></TR>
|
|
|
48 |
<TR><TD>FF_ARIAL</TD><TD>TTF font</TD><TD>Arial font</TD></TR>
|
|
|
49 |
<TR><TD>FF_VERDANA</TD><TD>TTF font</TD><TD>Verdana font</TD></TR>
|
|
|
50 |
<TR><TD>FF_COURIER</TD><TD>TTF font</TD><TD>Fix pitched courier</TD></TR>
|
|
|
51 |
<TR><TD>FF_BOOK</TD><TD>TTF font</TD><TD>Bookman</TD></TR>
|
|
|
52 |
<TR><TD>FF_COMIC</TD><TD>TTF font</TD><TD>Comic sans</TD></TR>
|
|
|
53 |
<TR><TD>FF_TIMES</TD><TD>TTF font</TD><TD>Times New Roman</TD></TR>
|
|
|
54 |
<TR><TD>FF_GEORGIA</TD><TD>TTF font</TD><TD>Georgia</TD></TR>
|
|
|
55 |
<TR><TD>FF_TREBUCHE</TD><TD>TTF font</TD><TD>Trebuche</TD></TR>
|
|
|
56 |
<TR><TD>FF_VERA</TD><TD>TTF font</TD><TD>Gnome Vera font, Available from
|
|
|
57 |
http://www.gnome.org/fonts/</TD></TR>
|
|
|
58 |
<TR><TD>FF_VERAMONO</TD><TD>TTF font</TD><TD>Gnome Vera Mono font,
|
|
|
59 |
Available from http://www.gnome.org/fonts/</TD></TR>
|
|
|
60 |
<TR><TD>FF_VERASERIF</TD><TD>TTF font</TD><TD>Gnome Vera Serif font,
|
|
|
61 |
Available from http://www.gnome.org/fonts/</TD></TR>
|
|
|
62 |
<TR><TD>FF_CHINESE</TD><TD>TTF font</TD><TD>Installed chinese font</TD></TR>
|
|
|
63 |
<TR><TD>FF_SIMSUN</TD><TD>TTF font</TD><TD>Installed chinese font</TD></TR>
|
|
|
64 |
<TR><TD>FF_BIG5</TD><TD>TTF font</TD><TD>Installed Chinese BIG5 font
|
|
|
65 |
(needs iconv())</TD></TR>
|
|
|
66 |
</TABLE>
|
|
|
67 |
<P> Please note that not all font families support all styles. The
|
|
|
68 |
figure below illustrates each of the available font families and what
|
|
|
69 |
styles you may use.<DIV class="example">
|
|
|
70 |
<BR> <A href="exframes/frame_listfontsex1.html" target="blank"><IMG border="0"
|
|
|
71 |
HEIGHT="450" src="img/listfontsex1.png" WIDTH="550"></A>
|
|
|
72 |
<BR><B>Figure 1:</B> Illustration of some of the available fonts in
|
|
|
73 |
JpGraph <A href="exframes/frame_listfontsex1.html" target="blank">[src]</A>
|
|
|
74 |
|
|
|
75 |
<P></P>
|
|
|
76 |
</DIV></P>
|
|
|
77 |
<P></P>
|
|
|
78 |
<P> We finally show some example of valid font specifications<DIV class="phpscript">
|
|
|
79 |
<CODE><FONT color="#000000"> <FONT color="#0000BB"> $graph</FONT><FONT color="#007700">
|
|
|
80 |
-></FONT><FONT color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
81 |
color="#0000BB">SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
82 |
FF_FONT2</FONT><FONT color="#007700">);
|
|
|
83 |
<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
84 |
color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
85 |
SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
86 |
FF_FONT2</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
87 |
FS_BOLD</FONT><FONT color="#007700">);
|
|
|
88 |
<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
89 |
color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
90 |
SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
91 |
FF_ARIAL</FONT><FONT color="#007700">);
|
|
|
92 |
<BR></FONT><FONT color="#0000BB">$graph</FONT><FONT color="#007700">-></FONT><FONT
|
|
|
93 |
color="#0000BB">title</FONT><FONT color="#007700">-></FONT><FONT color="#0000BB">
|
|
|
94 |
SetFont</FONT><FONT color="#007700">(</FONT><FONT color="#0000BB">
|
|
|
95 |
FF_ARIAL</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">
|
|
|
96 |
FS_BOLD</FONT><FONT color="#007700">,</FONT><FONT color="#0000BB">24</FONT><FONT
|
|
|
97 |
color="#007700">);</FONT><FONT color="#0000BB"></FONT></FONT></CODE></DIV>
|
|
|
98 |
</P>
|
|
|
99 |
<P></P>
|
|
|
100 |
<HR NOSHADE>
|
|
|
101 |
<A HREF="toc.html">Contents</A>
|
|
|
102 |
<A HREF="472VerifyingthattheTTFfontswork.html">Previous</A>
|
|
|
103 |
<A HREF="474AddingadditionalfontstoJpGraph.html">Next</A>
|
|
|
104 |
</BODY>
|
|
|
105 |
</HTML>
|