canvas.go
func TextExtent(text string) (int, int) {
	if text == "" {
		return 0, 0
	}
	parts := strings.Split(text, "\n")
	h := len(parts)
	w := 0
	for _, p := range parts {
		s := UnColorizeText(p)
		l := len(s)
		if l > w {
			w = l
		}
	}

	return h, w
}
func TextExtent(text string) (int, int) {
	if text == "" {
		return 0, 0
	}
	parts := strings.Split(text, "\n")
	h := len(parts)
	w := 0
	for _, p := range parts {
		s := UnColorizeText(p)
		l := len(s)
		if l > w {
			w = l
		}
	}

	return h, w
}
// TextExtent calculates the width and the height of the text