diff options
author | Kore Nordmann <github@kore-nordmann.de> | 2006-09-06 09:34:53 +0000 |
---|---|---|
committer | Kore Nordmann <github@kore-nordmann.de> | 2006-09-06 09:34:53 +0000 |
commit | b7b8d6da07309da4e16397f662a4e2db46c0869a (patch) | |
tree | a76a982bef0844f6d3d0eeb7089a7e8a5dfb2ee0 /tests/font_test.php | |
parent | 4e50ab6291dc2430ef9ce4cc42c100c021e1a3b0 (diff) | |
download | zetacomponents-graph-b7b8d6da07309da4e16397f662a4e2db46c0869a.zip zetacomponents-graph-b7b8d6da07309da4e16397f662a4e2db46c0869a.tar.gz |
- Enhanced font configuration
- Use Free Type 2 by default now, fallback to native ttf, if not available
- Use t1lib for PostScript Type1 fonts
- Throw an exception, if some texts could not be rendered with minimum font
size
Diffstat (limited to 'tests/font_test.php')
-rw-r--r-- | tests/font_test.php | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/tests/font_test.php b/tests/font_test.php index 3e6ee6d..00a13df 100644 --- a/tests/font_test.php +++ b/tests/font_test.php @@ -145,6 +145,46 @@ class ezcGraphFontTest extends ezcTestCase 'Font face for legend has not changed.' ); } + + public function testTTFFontType() + { + $chart = new ezcGraphLineChart(); + $chart->options->font->path = $this->basePath . 'font.ttf'; + + $this->assertSame( + $chart->options->font->type, + ezcGraph::TTF_FONT, + 'Font type is not TTF.' + ); + } + + public function testPSFontType() + { + $chart = new ezcGraphLineChart(); + $chart->options->font->path = $this->basePath . 'ps_font.pfb'; + + $this->assertSame( + $chart->options->font->type, + ezcGraph::PS_FONT, + 'Font type is not TTF.' + ); + } + + public function testUnknownFontType() + { + $chart = new ezcGraphLineChart(); + + try + { + $chart->options->font->path = $this->basePath . 'ez.png'; + } + catch ( ezcGraphUnknownFontTypeException $e ) + { + return true; + } + + $this->fail( 'Expected ezcGraphUnknownFontTypeException.' ); + } } ?> |