Skip to content

Cannot use default fonts for utf-8 text #29

@majid4466

Description

@majid4466

I know how to print utf-8 text with custom fonts. But how about Arial and Courier?

Here is code to show case the issue:

$pdf = new PDF();
$pdf->AddPage();

// Arial
$pdf->SetFont('Arial','',14);
$pdf->Text(10, 10, 'Beløp');

// Courier
$pdf->SetFont('Courier','',14);
$pdf->Text(10, 20, 'Beløp');

// Custom font
$pdf->AddFont('GreatVibes','','GreatVibes.ttf',true);
$pdf->SetFont('GreatVibes','',14);
$pdf->Text(10, 30, 'Beløp');

$pdf->Output();

And this is the result:
utf8-default-fonts

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