You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: font.go
    path of file: ./repos/OpenDiablo2/d2common/d2fileformats/d2font
    
    the code of the file until where you have to start completion: package d2font

import (
	"fmt"
	"image/color"
	"strings"

	"gith
    
func (f *Font) GetTextMetrics(text string) (width, height int) {
	var (
		lineWidth  int
		lineHeight int
	)

	for _, c := range text {
		if c == '\n' {
			width = d2math.MaxInt(width, lineWidth)
			height += lineHeight
			lineWidth = 0
			lineHeight = 0
		} else if glyph, ok := f.Glyphs[c]; ok {
			lineWidth += glyph.Width()
			lineHeight = d2math.MaxInt(lineHeight, glyph.Height())
		}
	}

	width = d2math.MaxInt(width, lineWidth)
	height += lineHeight

	return width, height
}