// Size returns the minimum (w, h) size in cells which can fit the text.
Size returns the minimum (w, h) size in cells which can fit the text.
// Size returns the minimum ( w h ) size in cells which can fit the text .
func (stt StyledText) Size() gruid.Point {
	x, y := 0, 0
	xmax := 0
	markup := stt.markups != nil 
	procm := false               
	for _, r := range stt.text {
		if markup {
			if procMarkup(procm, r) {
				procm = !procm
				continue
			}
			procm = false
		}
		if r == '\n' {
			if x > xmax {
				xmax = x
			}
			x = 0
			y++
			continue
		}
		x++
	}
	if x > xmax {
		xmax = x
	}
	if xmax > 0 || y > 0 {
		y++ 
	}
	return gruid.Point{X: xmax, Y: y}
}
func ( stt StyledText ) Size ( ) gruid . Point { x , y := 0 , 0 xmax := 0 markup := stt . markups != nil procm := false for _ , r := range stt . text { if markup { if procMarkup ( procm , r ) { procm = ! procm continue } procm = false } if r == '\n' { if x > xmax { xmax = x } x = 0 y ++ continue } x ++ } if x > xmax { xmax = x } if xmax > 0 || y > 0 { y ++ } return gruid . Point { X : xmax , Y : y } }
Size returns the minimum (w, h) size in cells which can fit the text.
Size returns the minimum ( w h ) size in cells which can fit the text .
// whether markup is activated // processing markup // at least one line