Khmer fonts again... in pdf this time

13 views
Skip to first unread message

Frederic Muller

unread,
Nov 6, 2019, 6:09:33 AM11/6/19
to PPLUG - Phnom Penh Linux Users Group
Hi!

Using mPDF to automatically save a php generated page into PDF I am
struggling getting Khmer characters out.

The Khmer display in the web application is fine, no issue there. When
trying to identify which fonts are being used I get this:
-apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto,
"Helvetica Neue", Arial, sans-serif

Now when trying to use mPDF for this same address I get various
unsatisfying results:
1. Fonts apparently need to be self hosted in a dedicated folder, making
a Google Fonts css call doesn't seem to work
2. Using KhmerOs fonts is the only way I'm getting some Khmer characters
so far. Unfortunately I am also getting empty squares between some of
the khmer letters while I should get nothing. No letter seems to be
missing though
3. Using all other fonts (I'm thinking of Noto Sans but tried Bayon and
others) I only get squares and no Khmer letters at all.
4. And since this is used for the name+address fields in fact I have
some Latin alphabet and Khmer alphabet combined. I haven't managed to
find a font which could display both at the same time. It seems I need
two div with 2 different font specifications.

This is not very Linux oriented but it'd be nice if someone had some
idea or directions.

Thank you very much.

Fred

Brad Collins

unread,
Nov 7, 2019, 3:11:36 AM11/7/19
to PPLUG - Phnom Penh Linux Users Group
As a last resort/ugly hack if the document is short you could import into Inkscape and then export the SVG as PDF.  Not ideal, I know, but it should work.

S.Kemter

unread,
Nov 7, 2019, 3:20:57 AM11/7/19
to pp...@googlegroups.com
Hust as long the font is not embedded Inkscape will not help you either. You have to tell mPDF to embed the font or convert them to paths. Don't ask me for the command ask pdfkungfu @ twitter

--
--
Post a message: pp...@googlegroups.com
Unsubscribe: pplug+un...@googlegroups.com
Options: http://groups.google.com/group/pplug?hl=en
---
You received this message because you are subscribed to the Google Groups "PPLUG - Phnom Penh Linux Users Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pplug+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/pplug/577447fc-8854-431a-9ffa-4d638fef4f26%40googlegroups.com.

Frederic Muller

unread,
Nov 27, 2019, 7:47:31 AM11/27/19
to pp...@googlegroups.com
Hi!

A bit of follow up: apparently it seems to be an issue with mPDF and
could be that the zero-width space is "printed" as an empty square in
PDF documents they generate. Still working on identifying the issue but
I'm somewhat hopeful we'll resolve the problem soon.

By any chance could someone confirm in the attached image that those
square are zero-width characters?

Thank you.

Fred

On 11/7/19 3:20 PM, S.Kemter wrote:
> Hust as long the font is not embedded Inkscape will not help you either.
> You have to tell mPDF to embed the font or convert them to paths. Don't
> ask me for the command ask pdfkungfu @ twitter
>
> Brad Collins <br...@chenla.la <mailto:br...@chenla.la>> schrieb am Do., 7.
> Post a message: pp...@googlegroups.com <mailto:pp...@googlegroups.com>
> Unsubscribe: pplug+un...@googlegroups.com
> <mailto:pplug%2Bunsu...@googlegroups.com>
> Options: http://groups.google.com/group/pplug?hl=en
> ---
> You received this message because you are subscribed to the Google
> Groups "PPLUG - Phnom Penh Linux Users Group" group.
> To unsubscribe from this group and stop receiving emails from it,
> send an email to pplug+un...@googlegroups.com
> <mailto:pplug+un...@googlegroups.com>.
> <https://groups.google.com/d/msgid/pplug/577447fc-8854-431a-9ffa-4d638fef4f26%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> --
> Post a message: pp...@googlegroups.com
> Unsubscribe: pplug+un...@googlegroups.com
> Options: http://groups.google.com/group/pplug?hl=en
> ---
> You received this message because you are subscribed to the Google
> Groups "PPLUG - Phnom Penh Linux Users Group" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to pplug+un...@googlegroups.com
> <mailto:pplug+un...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pplug/CAKBdXucXExHYyti20epUrv-UwcVoWiXJeJ7PhFZHZ7P_r%3DqHvA%40mail.gmail.com
> <https://groups.google.com/d/msgid/pplug/CAKBdXucXExHYyti20epUrv-UwcVoWiXJeJ7PhFZHZ7P_r%3DqHvA%40mail.gmail.com?utm_medium=email&utm_source=footer>.

Screenshot from 2019-11-08 13-17-05.png
Reply all
Reply to author
Forward
0 new messages