summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Westcott <joewestcott@users.noreply.github.com>2019-08-22 22:32:16 +0100
committerJoe Westcott <joewestcott@users.noreply.github.com>2019-08-22 22:32:16 +0100
commit1f076cb96ab154628c2f1087099e2d6159476e65 (patch)
tree0650bd64eeb04d709fc4186d145cbd5b20527684
parent06680f145154e962a17ba7aaf33ab597ce83ef2e (diff)
Add test for SetUnderlineThickness
-rw-r--r--fpdf_test.go23
-rw-r--r--pdf/reference/Fpdf_UnderlineThickness.pdfbin0 -> 1156 bytes
2 files changed, 23 insertions, 0 deletions
diff --git a/fpdf_test.go b/fpdf_test.go
index c6020f3..43cea30 100644
--- a/fpdf_test.go
+++ b/fpdf_test.go
@@ -2688,3 +2688,26 @@ func ExampleFpdf_RoundedRect() {
// Output:
// Successfully generated pdf/Fpdf_RoundedRect.pdf
}
+
+// ExampleFpdf_SetUnderlineThickness demonstrates how to adjust the text
+// underline thickness.
+func ExampleFpdf_SetUnderlineThickness() {
+ pdf := gofpdf.New("P", "mm", "A4", "") // 210mm x 297mm
+ pdf.AddPage()
+ pdf.SetFont("Arial", "U", 12)
+
+ pdf.SetUnderlineThickness(0.5)
+ pdf.CellFormat(0, 10, "Thin underline", "", 1, "", false, 0, "")
+
+ pdf.SetUnderlineThickness(1)
+ pdf.CellFormat(0, 10, "Normal underline", "", 1, "", false, 0, "")
+
+ pdf.SetUnderlineThickness(2)
+ pdf.CellFormat(0, 10, "Thicker underline", "", 1, "", false, 0, "")
+
+ fileStr := example.Filename("Fpdf_UnderlineThickness")
+ err := pdf.OutputFileAndClose(fileStr)
+ example.Summary(err, fileStr)
+ // Output:
+ // Successfully generated pdf/Fpdf_UnderlineThickness.pdf
+}
diff --git a/pdf/reference/Fpdf_UnderlineThickness.pdf b/pdf/reference/Fpdf_UnderlineThickness.pdf
new file mode 100644
index 0000000..49ad9b1
--- /dev/null
+++ b/pdf/reference/Fpdf_UnderlineThickness.pdf
Binary files differ