d2dlib icon indicating copy to clipboard operation
d2dlib copied to clipboard

Drawing a font in italic style

Open aizu03 opened this issue 4 years ago • 1 comments

Hi,

I love this library! I was trying to draw some text and everything worked but how do I draw text in italic?

This is the code I'm currently using:

var font = new Font("Consolas", 12f, FontStyle.Italic); d2d.DrawText("Some text in italic", D2DColor.White, font.Name, font.Size, 4, 4);

Is there a way to use the font object with all it's properties instead of the name and size? This would reduce overhead as well.

It would be nice to have this. I'm using the library to draw a little code interface. And multi line comments in italic would be a nice touch!

https://i.imgur.com/zAkFCQN.png

aizu03 avatar Aug 24 '21 16:08 aizu03

Thanks! I will add the support for style option as well as a font object as argument.

jingwood avatar Aug 25 '21 01:08 jingwood

It has been implemented in #94 from v1.4.1.

jingwood avatar Oct 31 '22 04:10 jingwood