diff --git a/typesetter.go b/typesetter.go index fff5be4..409bd73 100644 --- a/typesetter.go +++ b/typesetter.go @@ -175,6 +175,14 @@ func (this *TypeSetter) PositionAt (index int) fixed.Point26_6 { return position } +// ReccomendedHeightFor returns the reccomended max height if the text were to +// have its maximum width set to the given width. This does not actually move +// any text, it only simulates it. +func (this *TypeSetter) RecommendedHeight (width fixed.Int26_6) fixed.Int26_6 { + this.needMeasurement() + return recommendHeight(this.tokens, this.face, width) +} + // SetAlign sets the horizontal and vertical alignment of the text. func (this *TypeSetter) SetAlign (x, y Align) { if this.xAlign == x && this.yAlign == y { return }