VaKeR CYBER ARMY
Logo of a company Server : Apache
System : Linux host44.registrar-servers.com 4.18.0-513.18.1.lve.2.el8.x86_64 #1 SMP Sat Mar 30 15:36:11 UTC 2024 x86_64
User : vapecompany ( 2719)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /home/vapecompany/demo.vapecompany.com.bd/vendor/mpdf/mpdf/src/Conversion/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/vapecompany/demo.vapecompany.com.bd/vendor/mpdf/mpdf/src/Conversion/DecToOther.php
<?php

namespace Mpdf\Conversion;

use Mpdf\Mpdf;
use Mpdf\Utils\UtfString;

class DecToOther
{

	/**
	 * @var \Mpdf\Mpdf
	 */
	private $mpdf;

	public function __construct(Mpdf $mpdf)
	{
		$this->mpdf = $mpdf;
	}

	public function convert($num, $cp, $check = true)
	{
		// From printlistbuffer: font is set, so check if character is available
		// From docPageNum: font is not set, so no check
		$nstr = (string) $num;
		$rnum = '';
		$len = strlen($nstr);

		for ($i = 0; $i < $len; $i++) {
			if (!$check || $this->mpdf->_charDefined($this->mpdf->CurrentFont['cw'], $cp + ((int) $nstr[$i]))) {
				$rnum .= UtfString::code2utf($cp + (int) $nstr[$i]);
			} else {
				$rnum .= $nstr[$i];
			}
		}

		return $rnum;
	}

	/**
	 * @param string $script
	 * @return int
	 */
	public function getCodePage($script)
	{
		$codePages = [
			'arabic-indic' => 0x0660,
			'persian' => 0x06F0,
			'urdu' => 0x06F0,
			'bengali' => 0x09E6,
			'devanagari' => 0x0966,
			'gujarati' => 0x0AE6,
			'gurmukhi' => 0x0A66,
			'kannada' => 0x0CE6,
			'malayalam' => 0x0D66,
			'oriya' => 0x0B66,
			'telugu' => 0x0C66,
			'tamil' => 0x0BE6,
			'thai' => 0x0E50,
			'khmer' => 0x17E0,
			'cambodian' => 0x17E0,
			'lao' => 0x0ED0,
			'myanmar' => 0x1040
		];

		return isset($codePages[$script]) ? $codePages[$script] : 0;
	}

}

VaKeR 2022