Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you get the default system font in the .NET compact framework?

How can I get the Font object for the default system font used by the particular device? I've noticed that different devices have different resolutions and DPIs, but some of my controls have explicitly defined fonts. I'd like to be able to get the default system font at runtime (as if I never changed the Font property on the control).

like image 888
Jason Avatar asked Dec 15 '09 17:12

Jason


People also ask

What is the system default font?

Windows 10's default system font, Segoe UI, looks pretty nice. However, if you have something better to replace it with, you can change the default system font on your Windows 10 PC.

What is default font in C#?

If the above fonts are not installed, the default font is Tahoma, 8 point.

What is the default system font for Windows 10?

Even though the default fonts provided by Microsoft—Segoe UI for Windows 10, and Segoe UI variable for Windows 11—looks pretty neat on the screen, you don't have to settle if you have grown bored with them; especially when you can easily alter them with the Windows Registry.


1 Answers

Have you looked into System.Drawing.SystemFonts? I think it may have what you need.

https://msdn.microsoft.com/en-us/library/system.drawing.systemfonts.aspx

Edit: I just noticed the CF tag. You will need to look at the registry to get the system font information.

https://msdn.microsoft.com/en-us/library/ms900747.aspx

like image 51
TheHurt Avatar answered Sep 25 '22 13:09

TheHurt