當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Cpdf::setColor方法代碼示例

本文整理匯總了PHP中Cpdf::setColor方法的典型用法代碼示例。如果您正苦於以下問題:PHP Cpdf::setColor方法的具體用法?PHP Cpdf::setColor怎麽用?PHP Cpdf::setColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Cpdf的用法示例。


在下文中一共展示了Cpdf::setColor方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: text

 function text($x, $y, $text, $font, $size, $color = array(0, 0, 0), $adjust = 0, $angle = 0, $blend = "Normal", $opacity = 1.0)
 {
     list($r, $g, $b) = $color;
     $this->_pdf->setColor($r, $g, $b);
     $this->_set_line_transparency($blend, $opacity);
     $this->_set_fill_transparency($blend, $opacity);
     $font .= ".afm";
     $this->_pdf->selectFont($font);
     $this->_pdf->addText($x, $this->y($y) - Font_Metrics::get_font_height($font, $size), $size, utf8_decode($text), $angle, $adjust);
 }
開發者ID:SkMamtajuddin,項目名稱:bamboo-invoice,代碼行數:10,代碼來源:cpdf_adapter.cls.php

示例2: text

 function text($x, $y, $text, $font, $size, $color = array(0, 0, 0), $adjust = 0, $angle = 0, $blend = "Normal", $opacity = 1.0)
 {
     list($r, $g, $b) = $color;
     $this->_pdf->setColor($r, $g, $b);
     $this->_set_line_transparency($blend, $opacity);
     $this->_set_fill_transparency($blend, $opacity);
     $font .= ".afm";
     $this->_pdf->selectFont($font);
     //Font_Metrics::get_font_height($font, $size) ==
     //$this->get_font_height($font, $size) ==
     //$this->_pdf->selectFont($font),$this->_pdf->getFontHeight($size)
     //- FontBBoxheight+FontHeightOffset, scaled to $size, in pt
     //$this->_pdf->getFontDescender($size)
     //- Descender scaled to size
     //
     //$this->_pdf->fonts[$this->_pdf->currentFont] sizes:
     //['FontBBox'][0] left, ['FontBBox'][1] bottom, ['FontBBox'][2] right, ['FontBBox'][3] top
     //Maximum extent of all glyphs of the font from the baseline point
     //['Ascender'] maximum height above baseline except accents
     //['Descender'] maximum depth below baseline, negative number means below baseline
     //['FontHeightOffset'] manual enhancement of .afm files to trim windows fonts. currently not used.
     //Values are in 1/1000 pt for a font size of 1 pt
     //
     //['FontBBox'][1] should be close to ['Descender']
     //['FontBBox'][3] should be close to ['Ascender']+Accents
     //in practice, FontBBox values are a little bigger
     //
     //The text position is referenced to the baseline, not to the lower corner of the FontBBox,
     //for what the left,top corner is given.
     //FontBBox spans also the background box for the text.
     //If the lower corner would be used as reference point, the Descents of the glyphs would
     //hang over the background box border.
     //Therefore compensate only the extent above the Baseline.
     //
     //print '<pre>['.$font.','.$size.','.$this->_pdf->getFontHeight($size).','.$this->_pdf->getFontDescender($size).','.$this->_pdf->fonts[$this->_pdf->currentFont]['FontBBox'][3].','.$this->_pdf->fonts[$this->_pdf->currentFont]['FontBBox'][1].','.$this->_pdf->fonts[$this->_pdf->currentFont]['FontHeightOffset'].','.$this->_pdf->fonts[$this->_pdf->currentFont]['Ascender'].','.$this->_pdf->fonts[$this->_pdf->currentFont]['Descender'].']</pre>';
     //
     //$this->_pdf->addText($x, $this->y($y) - Font_Metrics::get_font_height($font, $size), $size, $text, $angle, $adjust);
     //$this->_pdf->addText($x, $this->y($y) - $size, $size, $text, $angle, $adjust);
     //$this->_pdf->addText($x, $this->y($y) - $this->_pdf->getFontHeight($size)-$this->_pdf->getFontDescender($size), $size, $text, $angle, $adjust);
     $this->_pdf->addText($x, $this->y($y) - $this->_pdf->fonts[$this->_pdf->currentFont]['FontBBox'][3] * $size / 1000, $size, $text, $angle, $adjust);
 }
開發者ID:kuwox,項目名稱:buenavista,代碼行數:41,代碼來源:cpdf_adapter.cls.php

示例3: _set_fill_color

 /**
  * Sets the fill colour
  *
  * See {@link Style::set_color()} for the format of the colour array.
  * @param array $color
  */
 protected function _set_fill_color($color)
 {
     $this->_pdf->setColor($color);
 }
開發者ID:skyosev,項目名稱:OpenCart-Overclocked,代碼行數:10,代碼來源:cpdf_adapter.cls.php


注:本文中的Cpdf::setColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。