swift-graphics icon indicating copy to clipboard operation
swift-graphics copied to clipboard

Is it a way to draw bold text with custom font?

Open j4nos opened this issue 3 years ago • 1 comments

I would use similar method

graphics.draw(Text("Test", at: Vec2(x: 0, y: 15)))

but I would set font and size also.

j4nos avatar Aug 09 '22 09:08 j4nos

Font size can already be set using e.g.

graphics.draw(Text("Test", fontSize: 14, at: Vec2(x: 0, y: 15)))

Bold text isn't currently supported, but if Cairo supports this it shouldn't be too hard to add (adding a fontWeight property to Text, then updating the implementation of draw(_ text: Text) in CairoGraphics). Feel free to open a PR!

fwcd avatar Oct 09 '22 21:10 fwcd