Added some test cases ....
[phpCairo.git] / testcases / phpCairo / select-font-face.php
blob284a939ce6efef9b6e76eaecc33651f28dd81fdf
1 <?
2 $TEXT_SIZE = 12;
3 $sur = new CairoImageSurface(FORMAT_ARGB32, 192, 16);
4 $con = new CairoContext($sur);
5 $con->save ();
6 $con->set_source_rgb ( 1.0, 1.0, 1.0); /* white */
7 $con->paint ();
8 $con->restore ();
10 $con->set_source_rgb ( 0, 0, 0); /* black */
12 $con->select_font_face ( "Bitstream Vera Serif",
13 FONT_SLANT_NORMAL,
14 FONT_WEIGHT_NORMAL);
15 $con->set_font_size ( $TEXT_SIZE);
17 $con->move_to ( 0, $TEXT_SIZE);
18 $con->show_text ( "i-am-serif");
20 $con->select_font_face ( "Bitstream Vera Sans",
21 FONT_SLANT_NORMAL,
22 FONT_WEIGHT_NORMAL);
23 $con->show_text ( " i-am-sans");
25 $con->select_font_face ( "Bitstream Vera Sans Mono",
26 FONT_SLANT_NORMAL,
27 FONT_WEIGHT_NORMAL);
28 $con->show_text ( " i-am-mono");
29 $sur->write_to_png("select-font-face-php.png");