Verified Commit 9ee4ab3f authored by Damien's avatar Damien

FEAT #12091 TIME 2:15 Attachment barcode

parent 80871ba0
<?php
/*
Barcode Render Class for PHP using the GD graphics library
Copyright (C) 2001 Karim Mribti
Version 0.0.7a 2001-04-01
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copy of GNU Lesser General Public License at: http://www.gnu.org/copyleft/lesser.txt
Source code home page: http://www.mribti.com/barcode/
Contact author at: barcode@mribti.com
+-----------------------------------------------------------------+
| Modified by Chirag Mehta - http://chir.ag/tech/download/pdfb |
|-----------------------------------------------------------------|
| For PDFB Library |
+-----------------------------------------------------------------+
*/
/***************************** base class ********************************************/
/* Styles */
define("BCS_BORDER" , 1);
define("BCS_TRANSPARENT" , 2);
define("BCS_ALIGN_CENTER" , 4);
define("BCS_ALIGN_LEFT" , 8);
define("BCS_ALIGN_RIGHT" , 16);
define("BCS_IMAGE_JPEG" , 32);
define("BCS_IMAGE_PNG" , 64);
define("BCS_DRAW_TEXT" , 128);
define("BCS_STRETCH_TEXT" , 256);
define("BCS_REVERSE_COLOR" , 512);
define("BCS_I25_DRAW_CHECK" , 2048); // For the I25 Only
/* Default values */
define("BCD_DEFAULT_BACKGROUND_COLOR", 0xFFFFFF);
define("BCD_DEFAULT_FOREGROUND_COLOR", 0x000000);
define("BCD_DEFAULT_STYLE" , BCS_ALIGN_CENTER | BCS_IMAGE_PNG | BCS_DRAW_TEXT | BCS_STRETCH_TEXT);
define("BCD_DEFAULT_WIDTH" , 216);
define("BCD_DEFAULT_HEIGHT" , 144);
define("BCD_DEFAULT_FONT" , 5);
define("BCD_DEFAULT_XRES" , 2);
/* Margins */
define("BCD_DEFAULT_MAR_Y1" , 10);
define("BCD_DEFAULT_MAR_Y2" , 10);
define("BCD_DEFAULT_TEXT_OFFSET" , 2);
define("BCD_DEFAULT_TEXT_FILL_OFFSET", -10);
/* For the I25 Only */
define("BCD_I25_NARROW_BAR" , 1);
define("BCD_I25_WIDE_BAR" , 2);
/* For the C39 Only */
define("BCD_C39_NARROW_BAR" , 1);
define("BCD_C39_WIDE_BAR" , 2);
/* For Code 128 */
define("BCD_C128_BAR_1" , 1);
define("BCD_C128_BAR_2" , 2);
define("BCD_C128_BAR_3" , 3);
define("BCD_C128_BAR_4" , 4);
class BarcodeObject
{
var $mWidth, $mHeight, $mStyle, $mBgcolor, $mBrush;
var $mImg, $mFont;
var $mError;
function BarcodeObject($Width = BCD_DEFAULT_WIDTH, $Height = BCD_DEFAULT_HEIGHT, $Style = BCD_DEFAULT_STYLE)
{
$this->mWidth = $Width;
$this->mHeight = $Height;
$this->mStyle = $Style;
$this->mFont = BCD_DEFAULT_FONT;
$this->mImg = ImageCreate($this->mWidth, $this->mHeight);
$dbColor = $this->mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_FOREGROUND_COLOR : BCD_DEFAULT_BACKGROUND_COLOR;
$dfColor = $this->mStyle & BCS_REVERSE_COLOR ? BCD_DEFAULT_BACKGROUND_COLOR : BCD_DEFAULT_FOREGROUND_COLOR;
$this->mBgcolor = ImageColorAllocate($this->mImg, ($dbColor & 0xFF0000) >> 16, ($dbColor & 0x00FF00) >> 8 , $dbColor & 0x0000FF);
$this->mBrush = ImageColorAllocate($this->mImg, ($dfColor & 0xFF0000) >> 16, ($dfColor & 0x00FF00) >> 8 , $dfColor & 0x0000FF);
if(!($this->mStyle & BCS_TRANSPARENT))
ImageFill($this->mImg, $this->mWidth, $this->mHeight, $this->mBgcolor);
}
function DrawObject($xres)
{
// Abstract function
return false;
}
function DrawBorder()
{
ImageRectangle($this->mImg, 0, 0, $this->mWidth-1, $this->mHeight-1, $this->mBrush);
}
function DrawChar($Font, $xPos, $yPos, $Char)
{
ImageString($this->mImg,$Font,$xPos,$yPos,$Char,$this->mBrush);
}
function DrawText($Font, $xPos, $yPos, $Char)
{
ImageString($this->mImg,$Font,$xPos,$yPos,$Char,$this->mBrush);
}
function DrawSingleBar($xPos, $yPos, $xSize, $ySize)
{
if($xPos>=0 && $xPos<=$this->mWidth && ($xPos+$xSize)<=$this->mWidth && $yPos>=0 && $yPos<=$this->mHeight && ($yPos+$ySize)<=$this->mHeight)
{
for($i=0;$i<$xSize;$i++)
ImageLine($this->mImg, $xPos+$i, $yPos, $xPos+$i, $yPos+$ySize, $this->mBrush);
return true;
}
return false;
}
function GetError()
{
return $this->mError;
}
function GetFontHeight($font)
{
return ImageFontHeight($font);
}
function GetFontWidth($font)
{
return ImageFontWidth($font);
}
function SetFont($font)
{
$this->mFont = $font;
}
function GetStyle()
{
return $this->mStyle;
}
function SetStyle($Style)
{
$this->mStyle = $Style;
}
function GetImage()
{
if(($this->mStyle & BCS_BORDER))
$this->DrawBorder();
ob_start();
if($this->mStyle & BCS_IMAGE_PNG)
ImagePng($this->mImg);
else if($this->mStyle & BCS_IMAGE_JPEG)
ImageJpeg($this->mImg, "", 100);
$imagedata = ob_get_contents();
ob_end_clean();
return $imagedata;
}
function FlushObject()
{
if(($this->mStyle & BCS_BORDER))
$this->DrawBorder();
if($this->mStyle & BCS_IMAGE_PNG)
{
Header("Content-Type: image/png");
ImagePng($this->mImg);
}
else if($this->mStyle & BCS_IMAGE_JPEG)
{
Header("Content-Type: image/jpeg");
ImageJpeg($this->mImg);
}
}
function DestroyObject()
{
ImageDestroy($this->mImg);
}
}
?>
\ No newline at end of file
<?php
/*
+-----------------------------------------------------------------+
| Created by Chirag Mehta - http://chir.ag/tech/download/pdfb |
|-----------------------------------------------------------------|
| For PDFB Library |
+-----------------------------------------------------------------+
*/
require("barcode.php");
require("c39.php");
require("c128a.php");
require("c128b.php");
require("c128c.php");
require("i25.php");
require("upca.php");
function generateBarCodeJPEG($code, $type = "C128B", $width = BCD_DEFAULT_WIDTH, $height = BCD_DEFAULT_HEIGHT, $style = BCD_DEFAULT_STYLE, $xres = BCD_DEFAULT_XRES, $font = BCD_DEFAULT_FONT, $flushimg = false)
{
$style = $style ^ BCS_IMAGE_PNG | BCS_IMAGE_JPEG;
return generateBarCodeImage($code, $type, $width, $height, $style, $xres, $font, $flushimg);
}
function generateBarCodePNG($code, $type = "C128B", $width = BCD_DEFAULT_WIDTH, $height = BCD_DEFAULT_HEIGHT, $style = BCD_DEFAULT_STYLE, $xres = BCD_DEFAULT_XRES, $font = BCD_DEFAULT_FONT, $flushimg = false)
{
$style = $style ^ BCS_IMAGE_JPEG | BCS_IMAGE_PNG;
return generateBarCodeImage($code, $type, $width, $height, $style, $xres, $font, $flushimg);
}
function generateBarCodeImage($code, $type = "C128B", $width = BCD_DEFAULT_WIDTH, $height = BCD_DEFAULT_HEIGHT, $style = BCD_DEFAULT_STYLE, $xres = BCD_DEFAULT_XRES, $font = BCD_DEFAULT_FONT, $flushimg = false)
{
$obj = false;
$barcodedata = false;
$code = trim($code);
if($code == "")
return false;
switch(strtoupper($type))
{
case "C39":
$obj = new C39Object($width, $height, $style, $code);
break;
case "C128A":
$obj = new C128AObject($width, $height, $style, $code);
break;
case "C128B":
// default is C128B
default:
$obj = new C128BObject($width, $height, $style, $code);
break;
case "C128C":
$obj = new C128CObject($width, $height, $style, $code);
break;
case "I25":
$obj = new I25Object($width, $height, $style, $code);
break;
case "UPCA":
$obj = new UPCAObject($width, $height, $style, $code);
break;
}
if($obj)
{
$obj->SetFont($font);
$obj->DrawObject($xres);
if($flushimg)
{
$obj->FlushObject();
$barcodedata = true;
}
else
{
$barcodedata = $obj->GetImage();
}
$obj->DestroyObject();
unset($obj);
}
return $barcodedata;
}
?>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
/*
Barcode Render Class for PHP using the GD graphics library
Copyright (C) 2001 Karim Mribti
Version 0.0.7a 2001-04-01
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copy of GNU Lesser General Public License at: http://www.gnu.org/copyleft/lesser.txt
Source code home page: http://www.mribti.com/barcode/
Contact author at: barcode@mribti.com
+-----------------------------------------------------------------+
| Modified by Chirag Mehta - http://chir.ag/tech/download/pdfb |
|-----------------------------------------------------------------|
| For PDFB Library |
+-----------------------------------------------------------------+
*/
/*
Render for Code 39
Code 39 is an alphanumeric bar code that can encode decimal number, case alphabet and some special symbols.
*/
class C39Object extends BarcodeObject {
var $mCharSet, $mChars;
function C39Object($Width, $Height, $Style, $Value)
{
$this->BarcodeObject($Width, $Height, $Style);
$this->mValue = $Value;
$this->mChars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. *$/+%";
$this->mCharSet = array
(
/* 0 */ "000110100",
/* 1 */ "100100001",
/* 2 */ "001100001",
/* 3 */ "101100000",
/* 4 */ "000110001",
/* 5 */ "100110000",
/* 6 */ "001110000",
/* 7 */ "000100101",
/* 8 */ "100100100",
/* 9 */ "001100100",
/* A */ "100001001",
/* B */ "001001001",
/* C */ "101001000",
/* D */ "000011001",
/* E */ "100011000",
/* F */ "001011000",
/* G */ "000001101",
/* H */ "100001100",
/* I */ "001001100",
/* J */ "000011100",
/* K */ "100000011",
/* L */ "001000011",
/* M */ "101000010",
/* N */ "000010011",
/* O */ "100010010",
/* P */ "001010010",
/* Q */ "000000111",
/* R */ "100000110",
/* S */ "001000110",
/* T */ "000010110",
/* U */ "110000001",
/* V */ "011000001",
/* W */ "111000000",
/* X */ "010010001",
/* Y */ "110010000",
/* Z */ "011010000",
/* - */ "010000101",
/* . */ "110000100",
/* SP */ "011000100",
/* * */ "010010100",
/* $ */ "010101000",
/* / */ "010100010",
/* + */ "010001010",
/* % */ "000101010"
);
}
function GetCharIndex ($char)
{
for ($i=0;$i<44;$i++) {
if ($this->mChars[$i] == $char)
return $i;
}
return -1;
}
function GetSize($xres)
{
$len = strlen($this->mValue);
if ($len == 0) {
$this->mError = "Null value";
return false;
}
for ($i=0;$i<$len;$i++) {
if ($this->GetCharIndex($this->mValue[$i]) == -1 || $this->mValue[$i] == '*') {
/* The asterisk is only used as a start and stop code */
$this->mError = "C39 not include the char '".$this->mValue[$i]."'";
return false;
}
}
/* Start, Stop is 010010100 == '*' */
$StartSize = BCD_C39_NARROW_BAR * $xres * 6 + BCD_C39_WIDE_BAR * $xres * 3;
$StopSize = BCD_C39_NARROW_BAR * $xres * 6 + BCD_C39_WIDE_BAR * $xres * 3;
$CharSize = BCD_C39_NARROW_BAR * $xres * 6 + BCD_C39_WIDE_BAR * $xres * 3; /* Same for all chars */
return $CharSize * $len + $StartSize + $StopSize + /* Space between chars */ BCD_C39_NARROW_BAR * $xres * ($len-1);
}
function DrawStart($DrawPos, $yPos, $ySize, $xres)
{ /* Start code is '*' */
$narrow = BCD_C39_NARROW_BAR * $xres;
$wide = BCD_C39_WIDE_BAR * $xres;
$this->DrawSingleBar($DrawPos, $yPos, $narrow , $ySize);
$DrawPos += $narrow;
$DrawPos += $wide;
$this->DrawSingleBar($DrawPos, $yPos, $narrow , $ySize);
$DrawPos += $narrow;
$DrawPos += $narrow;
$this->DrawSingleBar($DrawPos, $yPos, $wide , $ySize);
$DrawPos += $wide;
$DrawPos += $narrow;
$this->DrawSingleBar($DrawPos, $yPos, $wide , $ySize);
$DrawPos += $wide;
$DrawPos += $narrow;
$this->DrawSingleBar($DrawPos, $yPos, $narrow, $ySize);
$DrawPos += $narrow;
$DrawPos += $narrow; /* Space between chars */
return $DrawPos;
}
function DrawStop($DrawPos, $yPos, $ySize, $xres)
{ /* Stop code is '*' */
$narrow = BCD_C39_NARROW_BAR * $xres;
$wide = BCD_C39_WIDE_BAR * $xres;
$this->DrawSingleBar($DrawPos, $yPos, $narrow , $ySize);
$DrawPos += $narrow;
$DrawPos += $wide;
$this->DrawSingleBar($DrawPos, $yPos, $narrow , $ySize);
$DrawPos += $narrow;
$DrawPos += $narrow;
$this->DrawSingleBar($DrawPos, $yPos, $wide , $ySize);
$DrawPos += $wide;
$DrawPos += $narrow;
$this->DrawSingleBar($DrawPos, $yPos, $wide , $ySize);
$DrawPos += $wide;
$DrawPos += $narrow;
$this->DrawSingleBar($DrawPos, $yPos, $narrow, $ySize);
$DrawPos += $narrow;
return $DrawPos;
}
function DrawObject ($xres)
{
$len = strlen($this->mValue);
$narrow = BCD_C39_NARROW_BAR * $xres;
$wide = BCD_C39_WIDE_BAR * $xres;
if (($size = $this->GetSize($xres))==0) {
return false;
}
$cPos = 0;
if ($this->mStyle & BCS_ALIGN_CENTER) $sPos = (integer)(($this->mWidth - $size ) / 2);
else if ($this->mStyle & BCS_ALIGN_RIGHT) $sPos = $this->mWidth - $size;
else $sPos = 0;
/* Total height of bar code -Bars only- */
if ($this->mStyle & BCS_DRAW_TEXT) $ysize = $this->mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2 - $this->GetFontHeight($this->mFont);
else $ysize = $this->mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2;
$DrawPos = $this->DrawStart($sPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres);
do {
$c = $this->GetCharIndex($this->mValue[$cPos]);
$cset = $this->mCharSet[$c];
$this->DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[0] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[0] == '0') ? $narrow : $wide;
$DrawPos += ($cset[1] == '0') ? $narrow : $wide;
$this->DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[2] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[2] == '0') ? $narrow : $wide;
$DrawPos += ($cset[3] == '0') ? $narrow : $wide;
$this->DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[4] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[4] == '0') ? $narrow : $wide;
$DrawPos += ($cset[5] == '0') ? $narrow : $wide;
$this->DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[6] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[6] == '0') ? $narrow : $wide;
$DrawPos += ($cset[7] == '0') ? $narrow : $wide;
$this->DrawSingleBar($DrawPos, BCD_DEFAULT_MAR_Y1, ($cset[8] == '0') ? $narrow : $wide , $ysize);
$DrawPos += ($cset[8] == '0') ? $narrow : $wide;
$DrawPos += $narrow; /* Space between chars */
$cPos++;
} while ($cPos<$len);
$DrawPos = $this->DrawStop($DrawPos, BCD_DEFAULT_MAR_Y1 , $ysize, $xres);
/* Draw text */
if ($this->mStyle & BCS_DRAW_TEXT) {
if ($this->mStyle & BCS_STRETCH_TEXT) {
ImageFilledRectangle($this->mImg,
$sPos+($narrow*6+$wide*3)/2,
$ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET + BCD_DEFAULT_TEXT_FILL_OFFSET,
$sPos+($narrow*6+$wide*3)/2 + $size,
$ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET + BCD_DEFAULT_TEXT_FILL_OFFSET + $this->GetFontHeight($this->mFont),
$this->mBgcolor
);
for ($i=0;$i<$len;$i++) {
$this->DrawChar($this->mFont, $sPos+($narrow*6+$wide*3)+($size/$len)*$i,
$ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET + BCD_DEFAULT_TEXT_FILL_OFFSET, $this->mValue[$i]);
}
} else {/* Center */
$text_width = $this->GetFontWidth($this->mFont) * strlen($this->mValue);
$this->DrawText($this->mFont, $sPos+(($size-$text_width)/2)+($narrow*6+$wide*3),
$ysize + BCD_DEFAULT_MAR_Y1 + BCD_DEFAULT_TEXT_OFFSET, $this->mValue);
}
}
return true;
}
}
?>
\ No newline at end of file
<?php
/*
Barcode Render Class for PHP using the GD graphics library
Copyright (C) 2001 Karim Mribti
Version 0.0.7a 2001-04-01
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Copy of GNU Lesser General Public License at: http://www.gnu.org/copyleft/lesser.txt
Source code home page: http://www.mribti.com/barcode/
Contact author at: barcode@mribti.com
+-----------------------------------------------------------------+
| Modified by Chirag Mehta - http://chir.ag/tech/download/pdfb |
|-----------------------------------------------------------------|
| For PDFB Library |
+-----------------------------------------------------------------+
*/
/*
render for Interleaved 2 of 5
Interleaved 2 of 5 is a numeric only bar code with a optional check number.
*/
class I25Object extends BarcodeObject {
var $mCharSet;
function I25Object($Width, $Height, $Style, $Value)
{
$this->BarcodeObject($Width, $Height, $Style);
$this->mValue = $Value;
$this->mCharSet = array
(
/* 0 */ "00110",
/* 1 */ "10001",
/* 2 */ "01001",
/* 3 */ "11000",
/* 4 */ "00101",
/* 5 */ "10100",
/* 6 */ "01100",
/* 7 */ "00011",
/* 8 */ "10010",
/* 9 */ "01010"
);
}
function GetSize($xres)
{
$len = strlen($this->mValue);
if ($len == 0) {
$this->mError = "Null value";
return false;
}
for ($i=0;$i<$len;$i++) {
if ((ord($this->mValue[$i])<48) || (ord($this->mValue[$i])>57)) {
$this->mError = "I25 is numeric only";
return false;
}
}
if (($len%2) != 0) {
$this->mError = "The length of barcode value must be even";
return false;
}
$StartSize = BCD_I25_NARROW_BAR * 4 * $xres;
$StopSize = BCD_I25_WIDE_BAR * $xres + 2 * BCD_I25_NARROW_BAR * $xres;
$cPos = 0;
$sPos = 0;
do {
$c1 = $this->mValue[$cPos];
$c2 = $this->mValue[$cPos+1];
$cset1 = $this->mCharSet[$c1];
$cset2 = $this->mCharSet[$c2];
for ($i=0;$i<5;$i++) {
$type1 = ($cset1[$i]==0) ? (BCD_I25_NARROW_BAR * $xres) : (BCD_I25_WIDE_BAR * $xres);
$type2 = ($cset2[$i]==0) ? (BCD_I25_NARROW_BAR * $xres) : (BCD_I25_WIDE_BAR * $xres);
$sPos += ($type1 + $type2);
}
$cPos+=2;
} while ($cPos<$len);
return $sPos + $StartSize + $StopSize;
}
function DrawStart($DrawPos, $yPos, $ySize, $xres)
{ /* Start code is "0000" */
$this->DrawSingleBar($DrawPos, $yPos, BCD_I25_NARROW_BAR * $xres , $ySize);
$DrawPos += BCD_I25_NARROW_BAR * $xres;
$DrawPos += BCD_I25_NARROW_BAR * $xres;
$this->DrawSingleBar($DrawPos, $yPos, BCD_I25_NARROW_BAR * $xres , $ySize);
$DrawPos += BCD_I25_NARROW_BAR * $xres;
$DrawPos += BCD_I25_NARROW_BAR * $xres;
return $DrawPos;
}
function DrawStop($DrawPos, $yPos, $ySize, $xres)
{ /* Stop code is "100" */
$this->DrawSingleBar($DrawPos, $yPos, BCD_I25_WIDE_BAR * $xres , $ySize);
$DrawPos += BCD_I25_WIDE_BAR * $xres;
$DrawPos += BCD_I25_NARROW_BAR * $xres;
$this->DrawSingleBar($DrawPos, $yPos, BCD_I25_NARROW_BAR * $xres , $ySize);
$DrawPos += BCD_I25_NARROW_BAR * $xres;
return $DrawPos;
}
function DrawObject ($xres)
{
$len = strlen($this->mValue);
if (($size = $this->GetSize($xres))==0) {
return false;
}
$cPos = 0;
if ($this->mStyle & BCS_DRAW_TEXT) $ysize = $this->mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2 - $this->GetFontHeight($this->mFont);
else $ysize = $this->mHeight - BCD_DEFAULT_MAR_Y1 - BCD_DEFAULT_MAR_Y2;
if ($this->mStyle & BCS_ALIGN_CENTER) $sPos = (integer)(($this->mWidth - $size ) / 2);
else if ($this->mStyle & BCS_ALIGN_RIGHT) $sPos = $this->mWidth - $size;
else $sPos = 0;
$sPos = $this->DrawStart($sPos, BCD_DEFAULT_MAR_Y1, $ysize, $xres);
$nsPos = $sPos;
do {
$c1 = $this->mValue[$cPos];
$c2 = $this->mValue[$cPos+1];
$cset1 = $this->mCharSet[$c1];
$cset2 = $this->mCharSet[$c2];