summaryrefslogtreecommitdiff
path: root/font.go
diff options
context:
space:
mode:
authorDarkFreedman <misterdark@mail.ru>2019-04-19 17:00:39 +0300
committerDarkFreedman <misterdark@mail.ru>2019-04-19 17:00:39 +0300
commit0d6a38d49d631da305a6f17704f06f35c36cbddc (patch)
tree343d52bffa64a5055f4d90abf23a3aafbf4b69ce /font.go
parent5262aa851a9a9faf10c562b221986ac190099efc (diff)
Added full support for UTF-8 font. With MIT license.
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)