diff options
Diffstat (limited to 'fpdf_test.go')
-rw-r--r-- | fpdf_test.go | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/fpdf_test.go b/fpdf_test.go index 71fe7ad..f7ef961 100644 --- a/fpdf_test.go +++ b/fpdf_test.go @@ -602,22 +602,18 @@ func ExampleFpdf_SetKeywords() { err = gofpdf.MakeFont(example.FontFile("CalligrapherRegular.pfb"), example.FontFile("cp1252.map"), example.FontDir(), nil, true) if err == nil { - err = gofpdf.MakeFont(example.FontFile("calligra.ttf"), - example.FontFile("cp1252.map"), example.FontDir(), nil, true) - if err == nil { - pdf := gofpdf.New("", "", "", "") - pdf.SetFontLocation(example.FontDir()) - pdf.SetTitle("世界", true) - pdf.SetAuthor("世界", true) - pdf.SetSubject("世界", true) - pdf.SetCreator("世界", true) - pdf.SetKeywords("世界", true) - pdf.AddFont("Calligrapher", "", "CalligrapherRegular.json") - pdf.AddPage() - pdf.SetFont("Calligrapher", "", 16) - pdf.Writef(5, "\x95 %s \x95", pdf) - err = pdf.OutputFileAndClose(fileStr) - } + pdf := gofpdf.New("", "", "", "") + pdf.SetFontLocation(example.FontDir()) + pdf.SetTitle("世界", true) + pdf.SetAuthor("世界", true) + pdf.SetSubject("世界", true) + pdf.SetCreator("世界", true) + pdf.SetKeywords("世界", true) + pdf.AddFont("Calligrapher", "", "CalligrapherRegular.json") + pdf.AddPage() + pdf.SetFont("Calligrapher", "", 16) + pdf.Writef(5, "\x95 %s \x95", pdf) + err = pdf.OutputFileAndClose(fileStr) } example.Summary(err, fileStr) // Output: |