summaryrefslogtreecommitdiff
path: root/font.go
diff options
context:
space:
mode:
Diffstat (limited to 'font.go')
-rw-r--r--font.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/font.go b/font.go
index 7443a30..29417bb 100644
--- a/font.go
+++ b/font.go
@@ -83,6 +83,7 @@ func loadMap(encodingFileStr string) (encList encListType, err error) {
// getInfoFromTrueType returns information from a TrueType font
func getInfoFromTrueType(fileStr string, msgWriter io.Writer, embed bool, encList encListType) (info fontInfoType, err error) {
+ info.Widths = make([]int, 256)
var ttf TtfType
ttf, err = TtfParse(fileStr)
if err != nil {
@@ -168,6 +169,7 @@ func segmentRead(r io.Reader) (s segmentType, err error) {
// getInfoFromType1 return information from a Type1 font
func getInfoFromType1(fileStr string, msgWriter io.Writer, embed bool, encList encListType) (info fontInfoType, err error) {
+ info.Widths = make([]int, 256)
if embed {
var f *os.File
f, err = os.Open(fileStr)