user4655559
user4655559

Reputation:

Change font using Win2D drawtext

Does anyone know how to change the default font using win2d drawtext method? I need it to be a monospaced font like Courier New.

args.DrawingSession.DrawText("User : " + UNAME, 10, 350,Colors.White);

Upvotes: 1

Views: 726

Answers (2)

user4655559
user4655559

Reputation:

This was the answer I was looking for. I stumbled upon it earlier.

 args.DrawingSession.DrawText(Math.Round(percent * 100,1) + "%", Convert.ToSingle(pointX + 10), Convert.ToSingle(pointY), Color.FromArgb(255, 255, 255, 255), new CanvasTextFormat(){FontSize = 10 });


**new CanvasTextFormat(){FontSize = 10 }**

Upvotes: 1

Shawn Hargreaves
Shawn Hargreaves

Reputation: 264

Font is specified (along with other formatting information) by the CanvasTextFormat type. Use one of the many DrawText overloads that takes a text format parameter.

Upvotes: 0

Related Questions