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

Spaces in Chinese #276

Open
achafer opened this issue Jul 3, 2019 · 3 comments
Open

Spaces in Chinese #276

achafer opened this issue Jul 3, 2019 · 3 comments
Labels

Comments

@achafer
Copy link

achafer commented Jul 3, 2019

Hi, I found that when there are spaces in Chinese paragraphs, The final output style is not what I want

pdf := gofpdf.New("P", "mm", "A4", "")
pdf.AddUTF8Font("notosanssc", "", "../webfonts/NotoSansSC-Regular.ttf")
pdf.AddPage()
pdf.SetFont("notosanssc", "", 16)
str := "gofpdf支持UTF-8 TrueType字体和“right-to-left”语言。" +
	"请注意,许多通用字体中可能不包含中文、日文和 韩文字符。对于这些语言," +
	"可以使用专门的字体(例如,NotoSansSC 简体中文的字体)。"
pdf.MultiCell(0, 16, str, "", "L", false)
if err := pdf.OutputFileAndClose("hello.pdf"); err != nil {
	log.Fatal(err)
}

Output:

image

@jung-kurt
Copy link
Owner

Thanks for the report, @achafer. Any insights, @DarkFreedman?

@jung-kurt
Copy link
Owner

@achafer, can you confirm that this works as expected now?

@ArtemKor
Copy link

ArtemKor commented Oct 4, 2019

This space is part of glyphs. I used another font and got normal result
anotherfont

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

No branches or pull requests

3 participants