Here, how the story could explain in this result
As you see, it’s working!
It has some wrapper such as in Laravel and other PHP framework.
To make it works, we need to understand how to put the custom font and in mPDF it has a configuration (I did in Laravel, wrapper using: https://github.com/niklasravnsborg/laravel-pdf) in “config/pdf.php” to provide a font configure as:
"yourfont" => /* Khmer */ 'R' => "your-regularfont.ttf", 'useOTL' => 0xFF, // required for Khmer 'useKashida' => 75, // required for Khmer ],
That’s it but if you don’t know how it works, you will end up using wrong font. Most of case, Khmer Fonts are missing Latin characters, you need to know to check this, here is example of missing character:
With above makefont URL, it helps us to find a good font to use, in my case, it’s “Khmer OS Siemreap“, you test that you will see like this:
It’s a good font to use.
I think, it would work the same for library: TCPDF (https://tcpdf.org/) as it’s also an extender from FPDF.
To make it works for mPDF:
1. HTML header to add:
2. Custom Font
3. Use fontname in HTML tag