Thai Text (paid job)

146 views
Skip to first unread message

JPC

unread,
Jan 20, 2011, 7:00:28 PM1/20/11
to dompdf-dev
Hi, I need somebody to get Thai text working in PDFs for a client of
mine. Please include your price. Thanks.

BrianS

unread,
Jan 29, 2011, 10:59:48 AM1/29/11
to dompdf-dev
You should include some additional information in your request. For
example, what version of dompdf is the client using (0.5.1 does not
include Unicode support), time frame, and implementation details (is
dompdf being used as a plug-in inside another framework, is it part of
a custom-built web site, or will this be a new installation?).

You might see better results by also posting on the support forum.
This forum is used mainly by the dompdf team, so the number of
developers here is fairly small.

Also, if you're inclined to do this yourself at all we're more than
happy to provide guidance.

JPC

unread,
Feb 15, 2011, 2:36:50 PM2/15/11
to dompdf-dev
We are using 0.5.1 and need this ASAP. dompdf is being used as a
plugin. I can do this myself if direction is provided. Thanks.

BrianS

unread,
Feb 16, 2011, 12:53:32 PM2/16/11
to dompdf-dev
You won't be able to do this in dompdf 0.5.1 (at least, not easily).
The way to enable this would be to use a non-multibyte encoding and
specify a differences array. See the following post:
http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-extended-ascii-chars/

If you can upgrade to 0.6.0 it will be much easier. That version
includes Unicode support and so as long as you have the font the only
other thing you need is the appropriate styling and a UTF8-encoded
document.

JPC

unread,
Feb 23, 2011, 3:34:57 PM2/23/11
to dompdf-dev
Where can I find the font?

On Feb 16, 12:53 pm, BrianS <eclecticg...@gmail.com> wrote:
> You won't be able to do this in dompdf 0.5.1 (at least, not easily).
> The way to enable this would be to use a non-multibyte encoding and
> specify a differences array. See the following post:http://luca.priorelli.com/lang/en-us/2009/05/19/dompdf-justification-...

BrianS

unread,
Feb 25, 2011, 1:30:31 PM2/25/11
to dompd...@googlegroups.com
DOMPDF does not yet supply any internationalized fonts, but you can find plenty on the web. Here's one, but I can't vouch for the quality of the font.

Once you find a font you like you have to use the load_font.php script (which requires the ttf2ufm tool) to prepare the font for you system. You can also try the web-based font prep tool to prepare your font.

Woody Gilk

unread,
Feb 27, 2011, 11:06:17 PM2/27/11
to dompd...@googlegroups.com
Brian,

I think the issue goes deeper than just fonts in this case. I've
successfully run load_font.php on Thonburi (the font used in OSX to
render Thai text) to get Thai text support. However, all Thai glyphs
appear as question marks, as per the original report. My only style
is:

body { font-family: "Thonburi", "Times New Roman", serif; }

I thought this was a simple matter of someone not reading the
instructions and failing to Google, but that does not appear to be the
case. Font files being used are attached and any extra eyes would be
greatly appreciated.
--
Woody Gilk
http://about.me/shadowhand

> --
> You received this message because you are subscribed to the Google Groups "dompdf-dev" group.
> To post to this group, send email to dompd...@googlegroups.com.
> To unsubscribe from this group, send email to dompdf-dev+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/dompdf-dev?hl=en.
>
>

dompdf_font_family_cache.dist.php
Thonburi.afm
Thonburi.afm.php
Thonburi.ttf
ThonburiBold.afm
ThonburiBold.ttf

BrianS

unread,
Feb 28, 2011, 3:14:16 PM2/28/11
to dompd...@googlegroups.com
There are two other requirements:
  1. enable Unicode support in dompdf_config.inc.php
  2. ensure that your document is UTF8-encoded and include a meta header indicated as much, e.g.:

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

Woody Gilk

unread,
Feb 28, 2011, 3:19:22 PM2/28/11
to dompd...@googlegroups.com
On Mon, Feb 28, 2011 at 3:14 PM, BrianS <eclect...@gmail.com> wrote:
> There are two other requirements:
>
> enable Unicode support in dompdf_config.inc.php

def("DOMPDF_UNICODE_ENABLED", true)

> ensure that your document is UTF8-encoded and include a meta header

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>

Both requirements seem to be met, yet Thai text is still just lots of
question marks.

-Woody

Reply all
Reply to author
Forward
0 new messages