summaryrefslogtreecommitdiff
path: root/ttfparser_test.go
diff options
context:
space:
mode:
authorKurt Jung <kurt.w.jung@gmail.com>2015-08-26 20:44:07 -0400
committerKurt Jung <kurt.w.jung@gmail.com>2015-08-26 20:44:07 -0400
commit18c33c52f49afda63dabe7952b0ed98de6aead3a (patch)
treebccaf58af2d87d6f075a6b0388e6eee534018d8d /ttfparser_test.go
parente3a6324d33873b0347a190bfb82d7d04315c1c85 (diff)
Factor various test example helper routines into their own internal package
Diffstat (limited to 'ttfparser_test.go')
-rw-r--r--ttfparser_test.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/ttfparser_test.go b/ttfparser_test.go
index 9f494a6..3286db2 100644
--- a/ttfparser_test.go
+++ b/ttfparser_test.go
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013 Kurt Jung (Gmail: kurt.w.jung)
+ * Copyright (c) 2013-2015 Kurt Jung (Gmail: kurt.w.jung)
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -19,12 +19,13 @@ package gofpdf_test
import (
"bytes"
"fmt"
+
"github.com/jung-kurt/gofpdf"
- // "testing"
+ "github.com/jung-kurt/gofpdf/internal/example"
)
func ExampleTtfParse() {
- ttf, err := gofpdf.TtfParse(cnFontDir + "/calligra.ttf")
+ ttf, err := gofpdf.TtfParse(example.FontDir() + "/calligra.ttf")
if err == nil {
fmt.Printf("Postscript name: %s\n", ttf.PostScriptName)
fmt.Printf("unitsPerEm: %8d\n", ttf.UnitsPerEm)
@@ -55,7 +56,7 @@ func hexStr(s string) string {
}
func ExampleFpdf_GetStringWidth() {
- pdf := gofpdf.New("", "", "", cnFontDir)
+ pdf := gofpdf.New("", "", "", example.FontDir())
pdf.SetFont("Helvetica", "", 12)
pdf.AddPage()
for _, s := range []string{"Hello", "世界", "\xe7a va?"} {