laravel / cashier-stripe

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.
https://laravel.com/docs/billing
MIT License
2.38k stars 679 forks source link

Special characters in invoice templates #781

Closed pricop closed 5 years ago

pricop commented 5 years ago

Description:

It appears that special characters such as: Ț, Ș, Ă, are not working in the invoice template, they're always displayed as "?". Chinese, arabic and other characters are not working either.

Steps To Reproduce:

php artisan vendor:publish [11]. Add the characters in the invoice template. Preview an invoice.

driesvints commented 5 years ago

How are are you adding these characters? Please share some code.

pricop commented 5 years ago

I've localized my app, since the receipt view does make use of the Laravel localization feature, I had to publish the view in order to edit it.

I've attached an example of a receipt view that displays "?" for special characters. I've replaced the "Receipt", "Description", "Date" and "Amount" text strings with the above mentioned characters.

receipt.blade.zip

rocramer commented 5 years ago

You can get a few hints regarding your problem here: https://github.com/dompdf/dompdf/wiki/UnicodeHowTo

Maybe the font you are using do not support the characters you are using? Can you try it with the DejaVu font?

pricop commented 5 years ago

I didn't added any fonts whatsoever, I'm on a Windows 10 machine currently. The PDF was rendered using Times New Roman font, and this font has full support for the characters I've listed.

driesvints commented 5 years ago

Seems like this is more of an issue with the dompdf library. Maybe try opening an issue there?