[reportlab-users] I would like to use Hangul in paragraph.

Tim Roberts timr at probo.com
Mon May 9 13:17:54 EDT 2011


큰품아이 wrote:

>

> Hi All, (I can't English. Sorry!)

>

> I have been using Asian fonts (Korean).

> It is Hangul. (->바탕 font)

>

> Hangul appears first in the source.

> However, the second source, it appears broken.

> I would like to use Hangul in paragraph.

>


In your second source, you are not selecting the font. You get the
Helvetica font, which does not contain Korean characters. This is easy
to fix. Add these lines to your second script to make the font available:


> # font

>

> FONT_FILE = '%s/Fonts/%s' % (os.environ['WINDIR'], 'BATANG.TTC')

> FONT_NAME = '바탕'

> pdfmetrics.registerFont(TTFont(FONT_NAME, FONT_FILE))

>


Then, after you have picked the style:


> doc = SimpleDocTemplate("phello.pdf")

> Story = [Spacer(1,2*inch)]

> style = styles["Normal"]

>


Right here, add:
style.fontName = FONT_NAME

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20110509/a1a70ff9/attachment.htm>


More information about the reportlab-users mailing list