Closed vtereshkov closed 4 months ago
Instead I think there should be canvas::font.draw
which is an instance of Font
, but that means Font
is an interface. We need @marekmaskarinec to weigh in.
My proposed solution:
font::Font
to an interfacefont::TrueType
(name subject to change) which implements font::Font
canvas::PixelFont
(name subject to change) which is an empty struct that implements font::Font
using existing canvas functionsThis both prevents breaking and opens up possibilities for other types of fonts like bitmap fonts. What are your thoughts?
@marekmaskarinec What function will finally draw the text? The interface method Font.draw()
?
@marekmaskarinec What function will finally draw the text? The interface method
Font.draw()
?
Yes
My proposed solution:
- change
font::Font
to an interface- add
font::TrueType
(name subject to change) which implementsfont::Font
- add
canvas::PixelFont
(name subject to change) which is an empty struct that implementsfont::Font
using existing canvas functionsThis both prevents breaking and opens up possibilities for other types of fonts like bitmap fonts. What are your thoughts?
I agree. But how do we access the PixelFont?
Can
canvas::drawText()
take an optional^Font
parameter?