From 1d12c2036aa43d990448472679211a64f19db9cf Mon Sep 17 00:00:00 2001 From: "M. Sz" Date: Wed, 17 Feb 2021 08:28:23 +0100 Subject: [PATCH] hotfix: font table editor: added methods GetSize, and GetFrameIndex to font glyph --- d2common/d2fileformats/d2font/font.go | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/d2common/d2fileformats/d2font/font.go b/d2common/d2fileformats/d2font/font.go index 7789e277..e7fa70c6 100644 --- a/d2common/d2fileformats/d2font/font.go +++ b/d2common/d2fileformats/d2font/font.go @@ -35,12 +35,20 @@ func (fg *fontGlyph) setHeight(h int) { fg.height = h } +func (fg *fontGlyph) GetSize() (w, h int) { + return fg.width, fg.height +} + +func (fg *fontGlyph) GetFrameIndex() int { + return fg.frame +} + // Font represents a displayable font type Font struct { unknownHeaderBytes []byte sheet d2interface.Animation table []byte - glyphs map[rune]*fontGlyph + Glyphs map[rune]*fontGlyph color color.Color }