SetaFPDF icon indicating copy to clipboard operation
SetaFPDF copied to clipboard

Invalid doc block type hint for SetFont $size

Open MaximilianKresse opened this issue 2 years ago • 0 comments

The current doc block for the $size param of \setasign\SetaFpdf\SetaFpdf::SetFont() is:

@param string $size Font size in points. The default value is the current size. If no size has been specified 
                    since the beginning of the document, the value taken is 12.

Which calls internally \setasign\SetaFpdf\Modules\Font::set() which has the following doc block for $size:

@param string $size

But the size will be written into \setasign\SetaFpdf\StateBuffer\Font::$currentFontSize (without casting) which expects int|float.

The default of Fpdf for this method is also the integer 0 and not an empty string. This should be fixed.

MaximilianKresse avatar Mar 06 '24 09:03 MaximilianKresse