本文整理汇总了PHP中Zend\Barcode\Barcode::setBarcodeFont方法的典型用法代码示例。如果您正苦于以下问题:PHP Barcode::setBarcodeFont方法的具体用法?PHP Barcode::setBarcodeFont怎么用?PHP Barcode::setBarcodeFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend\Barcode\Barcode
的用法示例。
在下文中一共展示了Barcode::setBarcodeFont方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testNoFontWithOrientation
public function testNoFontWithOrientation()
{
$this->setExpectedException('\\Zend\\Barcode\\Renderer\\Exception\\ExceptionInterface');
Barcode\Barcode::setBarcodeFont(null);
$barcode = new Object\Code39(array('text' => '0123456789'));
$barcode->setOrientation(1);
$this->renderer->setBarcode($barcode);
$this->renderer->draw();
}
示例2: tearDown
public function tearDown()
{
Barcode\Barcode::setBarcodeFont(null);
if (!empty($this->originaltimezone)) {
date_default_timezone_set($this->originaltimezone);
}
}
示例3: testStaticFontAsNumber
public function testStaticFontAsNumber()
{
for ($i = 1; $i < 5; $i++) {
Barcode\Barcode::setBarcodeFont($i);
$this->assertEquals('', $this->_object->getFont());
$object = $this->_getBarcodeObject();
$this->assertEquals($i, $object->getFont());
Barcode\Barcode::setBarcodeFont('');
}
}
示例4: testDrawWithExistantResourceReturnResource
public function testDrawWithExistantResourceReturnResource()
{
Barcode\Barcode::setBarcodeFont(__DIR__ . '/../Object/_fonts/Vera.ttf');
$barcode = new Object\Code39(array('text' => '0123456789'));
$this->renderer->setBarcode($barcode);
$pdfResource = new Pdf\PdfDocument();
$this->renderer->setResource($pdfResource);
$resource = $this->renderer->draw();
$this->assertTrue($resource instanceof Pdf\PdfDocument);
$this->assertSame($resource, $pdfResource);
Barcode\Barcode::setBarcodeFont('');
}
示例5: testDrawWithExistantResourceReturnResource
public function testDrawWithExistantResourceReturnResource()
{
Barcode\Barcode::setBarcodeFont(__DIR__ . '/../Object/_fonts/Vera.ttf');
$barcode = new 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);
Barcode\Barcode::setBarcodeFont('');
}
示例6: testProxyBarcodeObjectFont
public function testProxyBarcodeObjectFont()
{
Barcode\Barcode::setBarcodeFont('my_font.ttf');
$barcode = new Object\Code25();
$this->assertSame('my_font.ttf', $barcode->getFont());
Barcode\Barcode::setBarcodeFont('');
}
示例7: tearDown
public function tearDown()
{
Barcode\Barcode::setBarcodeFont(null);
}
示例8: tearDown
public function tearDown()
{
Barcode\Barcode::setBarcodeFont(null);
date_default_timezone_set($this->_originaltimezone);
}
示例9: testNoFontWithOrientation
/**
* @expectedException \Zend\Barcode\Renderer\Exception
*/
public function testNoFontWithOrientation()
{
Barcode\Barcode::setBarcodeFont(null);
$barcode = new Object\Code39(array('text' => '0123456789'));
$barcode->setOrientation(1);
$this->_renderer->setBarcode($barcode);
$this->_renderer->draw();
}