dompdf / php-svg-lib

SVG file parsing / rendering library
GNU Lesser General Public License v3.0
1.39k stars 77 forks source link

Font size issues #82

Closed ArtemZlagoda closed 2 years ago

ArtemZlagoda commented 2 years ago

Hey! Faced a problem Nested tspan not getting the right font size Simple example

header("Content-Type: text/html; charset=utf-8");

include $_SERVER['DOCUMENT_ROOT'].'/vendor/autoload.php';

use Dompdf\Dompdf;

$svg = '<svg xmlns="http://www.w3.org/2000/svg" width="600" height="250">
                    <text x="10" y="10" font-size="18">F<tspan dy="4" font-size="6px">1</tspan></text>
                </svg>';

$html = '<img src="data:image/svg+xml;base64,'.base64_encode($svg).'"  width="600" height="250" />';

$dompdf = new Dompdf();
$dompdf->load_html($html, 'UTF-8');
$dompdf->setPaper('A4', 'portrait');
$dompdf->render();

$dompdf->stream("new_file.pdf");

In the file received from dompdf, the set font size for tspan is ignored, i.e. I get just F1 instead of F with index 1

bsweeney commented 2 years ago

tspan is not supported as of yet, watch #64 for updates

fateenarinah commented 1 month ago

Any progress on this? I'm experiencing the same issue.