本文整理匯總了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('');
}