Replaced implementation of WidthOf by TextWidth.

- TextDimensions (the underlying al_get_text_dimensions) returns the dimensions of the printable characters (non-whitespace) which gives weird results when measuring spaces.
This commit is contained in:
Sander Schobers 2019-04-13 10:18:00 +02:00
parent dbc017507c
commit 7f9f10075f

View File

@ -34,7 +34,7 @@ func (f *font) Height() float32 {
} }
func (f *font) WidthOf(t string) float32 { func (f *font) WidthOf(t string) float32 {
return f.Measure(t).Dx() return f.f.TextWidth(t)
} }
func (f *font) Measure(t string) geom.RectangleF32 { func (f *font) Measure(t string) geom.RectangleF32 {