0

Sample output

Here is the output, by right it should be like this

Expected output

Most of the time it print out correctly, but some time it not showing the correct characters

Here's my code

@font-face {
    font-family: 'street';
    src: url('{{ URL::to('/assets/fonts/street/street.eot') }}');
    src: url('{{ URL::to('/assets/fonts/street/street.eot?#iefix') }}') format('embedded-opentype'),
         url('{{ URL::to('/assets/fonts/street/street.woff2') }}') format('woff2'),
         url('{{ URL::to('/assets/fonts/street/street.woff') }}') format('woff'),
         url('{{ URL::to('/assets/fonts/street/street.ttf') }}') format('truetype'),
         url('{{ URL::to('/assets/fonts/street/street.svg#street') }}') format('svg');
    font-weight: normal;
    font-style: normal;
}

.hollow{font-family:street}

<font class="hollow" style="font-size:3em;line-height:200%;text-transform:uppercase;display:block;margin:0;position:absolute;top:5px;left:0;right:0;text-align:center">{{str_replace($shop_name_cleaner , '' , $company_name) }}</font>
<font class="hollow" style="{{(strlen($company_name) > 30) ? 'font-size:1.8em;top:81px' : 'font-size:1.8em;top:60px'}};text-transform:uppercase;margin:-29px 0 0 0;vertical-align:top;display:block;position:absolute;left:0;right:0;text-align:center">RESIT PAJAK</font>

Any idea what's going on?

Js Lim
  • 3,625
  • 6
  • 42
  • 80

1 Answers1

0

use Options class to set utf-8 encoding and custom font.

    $options = new Options();
    $options->set('defaultFont', 'DejaVu Sans');
    $dompdf = new Dompdf($options);
Gvep
  • 1,196
  • 2
  • 9
  • 18