From aeef2d5c4b27c5c882092435cd160d4b27215d75 Mon Sep 17 00:00:00 2001 From: "M. Sz" Date: Thu, 18 Feb 2021 20:20:38 +0100 Subject: [PATCH] font format: NewFontGlyph method --- d2common/d2fileformats/d2font/defaults.go | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 d2common/d2fileformats/d2font/defaults.go diff --git a/d2common/d2fileformats/d2font/defaults.go b/d2common/d2fileformats/d2font/defaults.go new file mode 100644 index 00000000..44b5a8e5 --- /dev/null +++ b/d2common/d2fileformats/d2font/defaults.go @@ -0,0 +1,17 @@ +package d2font + +// NewFontGlyph creates a new font glyph +func NewFontGlyph(frame, width, height int) *FontGlyph { + // nolint:gomnd // thes bytes are constant + // comes from https://d2mods.info/forum/viewtopic.php?t=42044 + result := &FontGlyph{ + unknown1: []byte{0, 0}, + unknown2: []byte{1, 0, 0}, + unknown3: []byte{0, 0, 0, 0, 0}, + frame: frame, + width: width, + height: height, + } + + return result +}