Skip to content
This repository has been archived by the owner on Nov 13, 2021. It is now read-only.

Add Chinese support #120

Open
dongweigogo opened this issue Jun 26, 2017 · 3 comments
Open

Add Chinese support #120

dongweigogo opened this issue Jun 26, 2017 · 3 comments

Comments

@dongweigogo
Copy link

dongweigogo commented Jun 26, 2017

I've seen some suggestions for adding Chinese support, but all have been closed. So, I raise it once again because that will benefit a lot of people!
And I found that another package (https://github.com/signintech/gopdf) has supported some utf-8 languages. Does that help in fixing this issue here?

@jung-kurt
Copy link
Owner

Does that help in fixing this issue here?

It may. But since font management touches so much of gofpdf, it may be more beneficial to consider a new branch that carries over features from gofpdf and lays them on top of gopdf.

@nanjj
Copy link
Contributor

nanjj commented Jun 10, 2019

	pdf := gofpdf.New("P", "mm", "A4", "")
	pdf.AddUTF8Font("NotoSansSC-Regular", "", "NotoSansSC-Regular.ttf")
	pdf.SetFont("NotoSansSC-Regular", "", 16)
	pdf.Cell(49, 10, "中文,你好!")

You can download the NotoSansSC-Regular.ttf file from https://github.com/jsntn/webfonts/, put it under your current directory.

@chy168
Copy link

chy168 commented Jun 11, 2019

Just ran into this problem, thanks the hints from @nanjj.

I would like to provide another open source family "Source Han Sans" font for Japanese, Korean, Simplified Chinese, and Traditional Chinese.

Note for Traditional Chinese and Japanese developers, there is a TTF converted version base on Source Han Sans. Download .ttf from here https://github.com/ButTaiwan/gensen-font

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants