Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Japanese font for PDF files



TLUG,

I'm working on a project right now where I have to create PDF files with
PHP. These PDF files will have to write out Japanese text on top of some
existing PDF templates.

I've got as far as creating the PDF and writing text into them. I'm
using PDFB library, as was recommended to me by someone on the PHP
user's list.
http://chir.ag/projects/pdfb/

The only sticking point now is that I need to use a Japanese font. The
PDFB scripts (which draw upon other commonly used PDF creation scripts)
does allow you to add the ability for other fonts and encodings, and
provides a handy tutorial:
http://www.fpdf.org/en/tutorial/tuto7.htm

What I'm stuck in is what font should I use. On the one hand, I can
embed a font into the PDF file. But with a Japanese font, that can bloat
the file by an additional 3 to 5 megabytes, which is a little extreme
for a one page document.

The other option is to rely on system fonts. Given that the people who
get these documents are likely to be PC and Mac users, what would be the
font I can declare.

I think part of what confuses me is that as a web guy, I'm used to using
CSS and declaring a family of fonts, and a list of fonts to default to
if the first choice is not available. With PDF, it seems you can declare
one font, and I'm unclear as to what happens if that font is not found.
That makes me a bit nervous about choosing the wrong font.

I'm hoping and assuming that I can use utf-8 as my encoding, since my
whole web application is utf-8 based and I dread mixing encodings.

Is there a Microsoft font that would be widely used enough? Am I
worrying over nothing and there is a way most systems handle this problem?

Any tips would be much appreciated.


-- 
Dave M G
http://tlug.jp/mediawiki/index.php?title=User:Dave_M_G


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links