• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Seretos / tcpdf-markdown / 17508958800

06 Sep 2025 02:47AM UTC coverage: 67.411% (-25.7%) from 93.103%
17508958800

push

github

Seretos
add first tcpdf implementations

1 of 211 new or added lines in 7 files covered. (0.47%)

513 of 761 relevant lines covered (67.41%)

21.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/Tcpdf/Elements/TcpdfText.php
1
<?php
2
declare(strict_types=1);
3
/**
4
 * author:  aappen
5
 * project: tcpdf-markdown
6
 */
7

8
namespace seretos\TCPDFMarkdown\Tcpdf\Elements;
9

10
use seretos\TCPDFMarkdown\Tcpdf\Pdf;
11
use seretos\TCPDFMarkdown\Tcpdf\TcpdfCell;
12
use seretos\TCPDFMarkdown\Tcpdf\TcpdfStyle;
13

14
class TcpdfText extends TcpdfCell
15
{
16
    private float $_width = .0;
17
    private float $_height = .0;
18

19
    public function __construct(Pdf $pdf, protected string $text, float $x, float $y, float $width, TcpdfStyle $style = new TcpdfStyle())
20
    {
NEW
21
        parent::__construct($pdf, $x, $y, $width, $style);
×
22
    }
23

24
    public function getHeight(): float
25
    {
NEW
26
        if($this->_height === .0)
×
NEW
27
            $this->_height = $this->pdf->getStringHeight($this->text, $this->style->getFamily(), $this->style->getFontStyle(), $this->style->getSize());
×
NEW
28
        return $this->_height;
×
29
    }
30

31
    public function getWidth(): float
32
    {
NEW
33
        if($this->_width === .0)
×
NEW
34
            $this->_width = $this->pdf->getStringWidth($this->text, $this->style->getFamily(), $this->style->getFontStyle(), $this->style->getSize());
×
NEW
35
        return $this->_width;
×
36
    }
37

38
    public function getText(): string {
NEW
39
        return $this->text;
×
40
    }
41

42
    public function render(): void
43
    {
NEW
44
        parent::render();
×
NEW
45
        $this->pdf->setXY($this->x, $this->y);
×
NEW
46
        $this->pdf->setFont($this->style->getFamily(), $this->style->getFontStyle(), $this->style->getSize());
×
NEW
47
        $this->pdf->setFontColor($this->style->getForegroundColor());
×
NEW
48
        $this->pdf->write($this->text, $this->getHeight(), $this->style->getLink());
×
49
    }
50
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc