Skip to content

Example by Ian Back fails with True type font #28

@anbrusi

Description

@anbrusi

$pdf->AddFont('DejaVu','','DejaVuSansCondensed.ttf',true);
$pdf->SetFont('DejaVu','',14);

// Load a UTF-8 string from a file and print it
$txt = file_get_contents('HelloWorld.txt');
$pdf->Write(8,$txt);

fails, because AddFont sets a font key "dejavu" while SetFont looks for "dejavusanscondensed". This is due to the fact, that within AddFont "dejavu" is replaced by "dejavusanscondensed" when dejavusanscondensed-font-metrics.php is included. Changing the last line in this file to $fontkey = 'dejavu' solves the problem. By the way, this is the value in the old file dejavusanscondensed.mtx.php.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions