summaryrefslogtreecommitdiff
path: root/ttfparser_test.go
diff options
context:
space:
mode:
authorJelmer Snoeck <jelmer.snoeck@gmail.com>2015-08-27 08:19:43 +0100
committerJelmer Snoeck <jelmer.snoeck@gmail.com>2015-08-27 08:19:43 +0100
commit31e5e1e5d2bcfe0e3dd7686ebbc13e6e780e246f (patch)
tree57037bc7d0ab8a4975db110b848a3adf3d0af382 /ttfparser_test.go
parent38c257b759987e1d7660b8fa3d62103bd99a76ff (diff)
parent18c33c52f49afda63dabe7952b0ed98de6aead3a (diff)
Merge branch 'master' of github.com:jung-kurt/gofpdf into contribution-package
* 'master' of github.com:jung-kurt/gofpdf: 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?"} {