From 0d6a38d49d631da305a6f17704f06f35c36cbddc Mon Sep 17 00:00:00 2001 From: DarkFreedman Date: Fri, 19 Apr 2019 17:00:39 +0300 Subject: Added full support for UTF-8 font. With MIT license. --- font.go | 2 ++ 1 file changed, 2 insertions(+) (limited to 'font.go') 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) -- cgit v1.2.1-24-ge1ad