Lines Matching refs:mpdf

14 	private $mpdf;
31 public function __construct(Mpdf $mpdf, Otl $otl, SizeConverter $sizeConverter, ColorConverter $colorConverter)
33 $this->mpdf = $mpdf;
49 $this->mpdf->SetLineHeight();
50 $h = $this->mpdf->lineheight;
53 $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
55 $wmax = ($w - ($this->mpdf->cMarginL + $this->mpdf->cMarginR));
57 if ($this->mpdf->usingCoreFont) {
60 $nb = mb_strlen($s, $this->mpdf->mb_enc);
63 $this->mpdf->x += $this->mpdf->GetStringWidth($s);
72 if (!$this->mpdf->usingCoreFont) {
73 if (preg_match('/([' . $this->mpdf->pregRTLchars . '])/u', $txt)) {
74 $this->mpdf->biDirectional = true;
78 $c = mb_substr($s, $i, 1, $this->mpdf->mb_enc);
81 $this->mpdf->ResetSpacing();
83 $tmp = rtrim(mb_substr($s, $j, $i - $j, $this->mpdf->mb_enc));
84 $this->mpdf->Cell($w, $h, $tmp, 0, 2, $align, $fill, $link);
91 $this->mpdf->x = $currentx;
93 $this->mpdf->x = $this->mpdf->lMargin;
95 $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
96 $wmax = ($w - ($this->mpdf->cMarginL + $this->mpdf->cMarginR));
104 $l += $this->mpdf->GetCharWidthNonCore($c); // mPDF 5.3.04
109 $this->mpdf->ResetSpacing();
110 if ($this->mpdf->x > $this->mpdf->lMargin) {
113 $this->mpdf->x = $currentx;
115 $this->mpdf->x = $this->mpdf->lMargin;
117 $this->mpdf->y+=$h;
118 $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
119 $wmax = ($w - ($this->mpdf->cMarginL + $this->mpdf->cMarginR));
127 $tmp = rtrim(mb_substr($s, $j, $i - $j, $this->mpdf->mb_enc));
128 $this->mpdf->Cell($w, $h, $tmp, 0, 2, $align, $fill, $link);
130 $tmp = rtrim(mb_substr($s, $j, $sep - $j, $this->mpdf->mb_enc));
138 $len_ligne = $this->mpdf->GetStringWidth($tmp);
139 $nb_carac = mb_strlen($tmp, $this->mpdf->mb_enc);
140 $nb_spaces = mb_substr_count($tmp, ' ', $this->mpdf->mb_enc);
142 if (!empty($this->mpdf->CurrentFont['useOTL']) && preg_match('/([' . $this->mpdf->pregCURSchars . '])/u', $tmp)) {
145 list($charspacing, $ws) = $this->mpdf->GetJspacing($nb_carac, $nb_spaces, (($w - 2) - $len_ligne) * Mpdf::SCALE, $inclCursive);
146 $this->mpdf->SetSpacing($charspacing, $ws);
149 $this->mpdf->Cell($w, $h, $tmp, 0, 2, $align, $fill, $link);
157 $this->mpdf->x = $currentx;
159 $this->mpdf->x = $this->mpdf->lMargin;
161 $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
162 $wmax = ($w - ($this->mpdf->cMarginL + $this->mpdf->cMarginR));
171 $this->mpdf->ResetSpacing();
179 $this->mpdf->ResetSpacing();
180 $this->mpdf->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, $align, $fill, $link);
187 $this->mpdf->x = $currentx;
189 $this->mpdf->x = $this->mpdf->lMargin;
191 $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
192 $wmax = $w - ($this->mpdf->cMarginL + $this->mpdf->cMarginR);
200 $l += $this->mpdf->GetCharWidthCore($c); // mPDF 5.3.04
205 $this->mpdf->ResetSpacing();
206 if ($this->mpdf->x > $this->mpdf->lMargin) {
209 $this->mpdf->x = $currentx;
211 $this->mpdf->x = $this->mpdf->lMargin;
213 $this->mpdf->y+=$h;
214 $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
215 $wmax = $w - ($this->mpdf->cMarginL + $this->mpdf->cMarginR);
223 $this->mpdf->Cell($w, $h, substr($s, $j, $i - $j), 0, 2, $align, $fill, $link);
232 $len_ligne = $this->mpdf->GetStringWidth($tmp);
235 list($charspacing, $ws) = $this->mpdf->GetJspacing($nb_carac, $nb_spaces, (($w - 2) - $len_ligne) * Mpdf::SCALE, $false);
236 $this->mpdf->SetSpacing($charspacing, $ws);
239 $this->mpdf->Cell($w, $h, $tmp, 0, 2, $align, $fill, $link);
247 $this->mpdf->x = $currentx;
249 $this->mpdf->x = $this->mpdf->lMargin;
251 $w = $this->mpdf->w - $this->mpdf->rMargin - $this->mpdf->x;
252 $wmax = $w - ($this->mpdf->cMarginL + $this->mpdf->cMarginR);
260 $this->mpdf->ResetSpacing();
265 $this->mpdf->x = $currentx;
267 $this->mpdf->x = $this->mpdf->lMargin;
269 if ($this->mpdf->usingCoreFont) {
272 $tmp = mb_substr($s, $j, $i - $j, $this->mpdf->mb_enc);
274 $this->mpdf->Cell($w, $h, $tmp, 0, 0, $align, $fill, $link);
281 $this->mpdf->SetFont($fontfamily, $fontstyle, $fontsizePt);
305 if ($this->mpdf->usingCoreFont) {
308 $w[$i] = $this->mpdf->GetStringWidth($text[$i]);
313 $nb = mb_strlen($text, $this->mpdf->mb_enc);
315 $unicode = $this->mpdf->UTF8StringToArray($text);
317 $c = mb_substr($text, $i, 1, $this->mpdf->mb_enc);
318 $w[$i] = $this->mpdf->GetStringWidth($c);
321 if ($this->mpdf->useKerning && $lastchar && isset($this->mpdf->CurrentFont['kerninfo'][$lastchar][$char])) {
322 $tk = $this->mpdf->CurrentFont['kerninfo'][$lastchar][$char] * ($this->mpdf->FontSize / 1000) * $kerning * $fontwidth;
334 $t+=$this->mpdf->GetStringWidth(' ');
336 $t+=$this->mpdf->GetStringWidth(' ');
339 $fontsizePt = $this->mpdf->FontSizePt * 0.5 * $u / $t;
341 $fontsizePt = $this->mpdf->FontSizePt * $u / $t;
343 $this->mpdf->SetFontSize($fontsizePt);
351 $this->mpdf->StartTransform();
356 $this->mpdf->transformRotate(-$d / 2, $x, $y);
358 $this->mpdf->transformRotate($d / 2, $x, $y);
368 $this->mpdf->transformRotate((($w[$i] / 2) / $u) * 360, $x, $y);
370 $this->mpdf->transformRotate((($w[$i] / 2 + $w[$i - 1] / 2) / $u) * 360, $x, $y);
374 $this->mpdf->StartTransform();
375 $this->mpdf->transformScale($fontwidth * 100, 100, $x, $y);
378 $this->mpdf->SetXY($x - $w[$i] / 2, $y - $r);
384 $this->mpdf->transformRotate(-(($w[$i] / 2) / $u) * 360, $x, $y);
386 $this->mpdf->transformRotate(-(($w[$i] / 2 + $w[$i - 1] / 2) / $u) * 360, $x, $y);
390 $this->mpdf->StartTransform();
391 $this->mpdf->transformScale($fontwidth * 100, 100, $x, $y);
393 $this->mpdf->SetXY($x - $w[$i] / 2, $y + $r - $this->mpdf->FontSize);
396 if ($this->mpdf->usingCoreFont) {
399 $c = mb_substr($text, $i, 1, $this->mpdf->mb_enc);
402 $this->mpdf->Cell($w[$i], $this->mpdf->FontSize, $c, 0, 0, 'C'); // mPDF 5.3.53
405 $this->mpdf->StopTransform();
409 $this->mpdf->StopTransform();
413 $wc = $this->mpdf->GetStringWidth($divider);
416 $this->mpdf->StartTransform();
417 $this->mpdf->transformRotate(90, $x, $y);
418 $this->mpdf->SetXY($x - $wc / 2, $y - $r);
419 $this->mpdf->Cell($wc, $this->mpdf->FontSize, $divider, 0, 0, 'C');
420 $this->mpdf->StopTransform();
422 $this->mpdf->StartTransform();
423 $this->mpdf->transformRotate(-90, $x, $y);
424 $this->mpdf->SetXY($x - $wc / 2, $y - $r);
425 $this->mpdf->Cell($wc, $this->mpdf->FontSize, $divider, 0, 0, 'C');
426 $this->mpdf->StopTransform();
434 $font = $this->mpdf->default_font;
437 $szfont = $this->mpdf->default_font_size * 1.8;
441 $this->mpdf->SetFont($font, $fontstyle, $szfont, false);
443 $text = $this->mpdf->purify_utf8_text($text);
445 if ($this->mpdf->text_input_as_HTML) {
446 $text = $this->mpdf->all_entities_to_utf8($text);
449 if ($this->mpdf->usingCoreFont) {
450 $text = mb_convert_encoding($text, $this->mpdf->mb_enc, 'UTF-8');
455 if (preg_match('/([' . $this->mpdf->pregRTLchars . '])/u', $text)) {
456 $this->mpdf->biDirectional = true;
460 $save_OTLtags = $this->mpdf->OTLtags;
461 $this->mpdf->OTLtags = [];
463 if ($this->mpdf->useKerning) {
464 if ($this->mpdf->CurrentFont['haskernGPOS']) {
465 $this->mpdf->OTLtags['Plus'] .= ' kern';
471 if (!empty($this->mpdf->CurrentFont['useOTL'])) {
472 $text = $this->otl->applyOTL($text, $this->mpdf->CurrentFont['useOTL']);
475 $this->mpdf->OTLtags = $save_OTLtags;
477 $this->mpdf->magic_reverse_dir($text, $this->mpdf->directionality, $OTLdata);
480 $width = $this->mpdf->pgwidth;
482 $width = $this->sizeConverter->convert($width, $this->mpdf->pgwidth);
484 $midpt = $this->mpdf->lMargin + ($this->mpdf->pgwidth / 2);
485 $r1 = $midpt - ($width / 2); //($this->mpdf->w / 2) - 40;
487 $y1 = $this->mpdf->y;
492 $this->mpdf->SetFont($font, $fontstyle, $szfont, false);
493 $sz = $this->mpdf->GetStringWidth($text, true, $OTLdata, $textvar);
500 $this->mpdf->SetFont($font, $fontstyle, $szfont, true, true);
502 $y2 = $this->mpdf->FontSize + ($pad * 2);
504 $this->mpdf->SetLineWidth(0.1);
505 $fc = $this->colorConverter->convert($fill, $this->mpdf->PDFAXwarnings);
506 $tc = $this->colorConverter->convert($color, $this->mpdf->PDFAXwarnings);
507 $this->mpdf->SetFColor($fc);
508 $this->mpdf->SetTColor($tc);
509 $this->mpdf->RoundedRect($r1, $y1, $r2 - $r1, $y2, $radius, $style);
510 $this->mpdf->SetX($r1);
511 $this->mpdf->Cell($r2 - $r1, $y2, $text, 0, 1, 'C', 0, '', 0, 0, 0, 'M', 0, false, $OTLdata, $textvar);
512 $this->mpdf->SetY($y1 + $y2 + 2); // +2 = mm margin below shaded box
513 $this->mpdf->Reset();