Extracted a FontStyle object to encapsulate string size calculations (in preparation for supporting size_px)
Wrote a few tests covering most of the features involving string size calculation (except rendering - so please check if it all still looks alright :D)
Use @font and @size_enum to construct a FontStyle object which can calculate string width & font_height
Use @font_style.string_width instead of calcstringbox everywhere and pass around @font_style instead of @font and @size_enum
Also added a FontStyle#label method as convenience to construct a label primitive hash with the correct values added
Also fixed a bug which prevented you from specifying size_enum as a number
Extracted a
FontStyle
object to encapsulate string size calculations (in preparation for supportingsize_px
)@font
and@size_enum
to construct aFontStyle
object which can calculate string width & font_height@font_style.string_width
instead ofcalcstringbox
everywhere and pass around@font_style
instead of@font
and@size_enum
FontStyle#label
method as convenience to construct a label primitive hash with the correct values addedAlso fixed a bug which prevented you from specifying
size_enum
as a number