本文整理汇总了PHP中Zend_Barcode::setBarcodeFont方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Barcode::setBarcodeFont方法的具体用法?PHP Zend_Barcode::setBarcodeFont怎么用?PHP Zend_Barcode::setBarcodeFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_Barcode
的用法示例。
在下文中一共展示了Zend_Barcode::setBarcodeFont方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testDrawWithExistantResourceReturnResource
public function testDrawWithExistantResourceReturnResource()
{
Zend_Barcode::setBarcodeFont(dirname(__FILE__) . '/../Object/_fonts/Vera.ttf');
$barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789'));
$this->_renderer->setBarcode($barcode);
$pdfResource = new Zend_Pdf();
$this->_renderer->setResource($pdfResource);
$resource = $this->_renderer->draw();
$this->assertTrue($resource instanceof Zend_Pdf);
$this->assertSame($resource, $pdfResource);
Zend_Barcode::setBarcodeFont('');
}
示例2: testDrawWithExistantResourceReturnResource
public function testDrawWithExistantResourceReturnResource()
{
Zend_Barcode::setBarcodeFont(dirname(__FILE__) . '/../Object/_fonts/Vera.ttf');
$barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789'));
$this->_renderer->setBarcode($barcode);
$svgResource = new DOMDocument();
$rootElement = $svgResource->createElement('svg');
$rootElement->setAttribute('xmlns', "http://www.w3.org/2000/svg");
$rootElement->setAttribute('version', '1.1');
$rootElement->setAttribute('width', 500);
$rootElement->setAttribute('height', 300);
$svgResource->appendChild($rootElement);
$this->_renderer->setResource($svgResource);
$resource = $this->_renderer->draw();
$this->assertTrue($resource instanceof DOMDocument);
$this->assertSame($resource, $svgResource);
Zend_Barcode::setBarcodeFont('');
}
示例3: testProxyBarcodeObjectFont
public function testProxyBarcodeObjectFont()
{
Zend_Barcode::setBarcodeFont('my_font.ttf');
$barcode = new Zend_Barcode_Object_Code25();
$this->assertSame('my_font.ttf', $barcode->getFont());
Zend_Barcode::setBarcodeFont('');
}
示例4: testNoFontWithOrientation
/**
* @expectedException Zend_Barcode_Renderer_Exception
*/
public function testNoFontWithOrientation()
{
Zend_Barcode::setBarcodeFont('');
$barcode = new Zend_Barcode_Object_Code39(array('text' => '0123456789'));
$barcode->setOrientation(1);
$this->_renderer->setBarcode($barcode);
$this->_renderer->draw();
}
示例5: tearDown
public function tearDown()
{
Zend_Barcode::setBarcodeFont('');
}