From 5d0bba740b8c3f5619d5a39b724f4d59e99fe4b4 Mon Sep 17 00:00:00 2001 From: Franz Fangmeyer Date: Sat, 7 Sep 2019 12:14:28 +0200 Subject: Strikeout: use "S" as styleStr --- fpdf_test.go | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) (limited to 'fpdf_test.go') diff --git a/fpdf_test.go b/fpdf_test.go index 43cea30..267bc6c 100644 --- a/fpdf_test.go +++ b/fpdf_test.go @@ -20,6 +20,9 @@ import ( "bufio" "bytes" "fmt" + "gofpdf" + "gofpdf/internal/example" + "gofpdf/internal/files" "io" "io/ioutil" "math" @@ -31,10 +34,6 @@ import ( "strings" "testing" "time" - - "github.com/jung-kurt/gofpdf" - "github.com/jung-kurt/gofpdf/internal/example" - "github.com/jung-kurt/gofpdf/internal/files" ) func init() { @@ -2711,3 +2710,22 @@ func ExampleFpdf_SetUnderlineThickness() { // Output: // Successfully generated pdf/Fpdf_UnderlineThickness.pdf } + +// ExampleFpdf_strikeout demonstrates striked-out text +func ExampleFpdf_strikeout() { + + pdf := gofpdf.New("P", "mm", "A4", "") // 210mm x 297mm + pdf.AddPage() + + for fontSize := 4; fontSize < 40; fontSize += 10 { + pdf.SetFont("Arial", "S", float64(fontSize)) + pdf.SetXY(0, float64(fontSize)) + pdf.Cell(40, 10, "Hello World\n") + } + + fileStr := example.Filename("Fpdf_strikeout") + err := pdf.OutputFileAndClose(fileStr) + example.Summary(err, fileStr) + // Output: + // Successfully generated pdf/Fpdf_strikeout.pdf +} -- cgit v1.2.1-24-ge1ad From e123b55aba2106cced7941e31391fff7e59d200d Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 7 Sep 2019 13:01:30 -0400 Subject: Adjust various import paths, rename example function --- fpdf_test.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'fpdf_test.go') diff --git a/fpdf_test.go b/fpdf_test.go index 267bc6c..5035bd8 100644 --- a/fpdf_test.go +++ b/fpdf_test.go @@ -20,9 +20,6 @@ import ( "bufio" "bytes" "fmt" - "gofpdf" - "gofpdf/internal/example" - "gofpdf/internal/files" "io" "io/ioutil" "math" @@ -34,6 +31,10 @@ import ( "strings" "testing" "time" + + "github.com/jung-kurt/gofpdf" + "github.com/jung-kurt/gofpdf/internal/example" + "github.com/jung-kurt/gofpdf/internal/files" ) func init() { @@ -2711,8 +2712,8 @@ func ExampleFpdf_SetUnderlineThickness() { // Successfully generated pdf/Fpdf_UnderlineThickness.pdf } -// ExampleFpdf_strikeout demonstrates striked-out text -func ExampleFpdf_strikeout() { +// ExampleFpdf_Cell_strikeout demonstrates striked-out text +func ExampleFpdf_Cell_strikeout() { pdf := gofpdf.New("P", "mm", "A4", "") // 210mm x 297mm pdf.AddPage() @@ -2720,12 +2721,12 @@ func ExampleFpdf_strikeout() { for fontSize := 4; fontSize < 40; fontSize += 10 { pdf.SetFont("Arial", "S", float64(fontSize)) pdf.SetXY(0, float64(fontSize)) - pdf.Cell(40, 10, "Hello World\n") + pdf.Cell(40, 10, "Hello World") } - fileStr := example.Filename("Fpdf_strikeout") + fileStr := example.Filename("Fpdf_Cell_strikeout") err := pdf.OutputFileAndClose(fileStr) example.Summary(err, fileStr) // Output: - // Successfully generated pdf/Fpdf_strikeout.pdf + // Successfully generated pdf/Fpdf_Cell_strikeout.pdf } -- cgit v1.2.1-24-ge1ad