jingwood / d2dlib

A .NET library for hardware-accelerated, high performance, immediate mode rendering via Direct2D.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Drawing a font in italic style

aizu03 opened this issue · 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

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

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