Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8591649
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:34:29+00:00 2026-06-11T23:34:29+00:00

Possible Duplicate: Test if a Font is installed let say Im using an installed

  • 0

Possible Duplicate:
Test if a Font is installed

let say Im using an installed font on the system:

new System.Drawing.Font("Arial", 120F);

everything is fine. Now if I would use a not existing font:

new System.Drawing.Font("IdoNotExistHaHa", 120F);

I dont get any exception. As I see, if I use a font that doesnt exist I get a standard font (arial?, not sure). Whatever, I would like to throw an exception if there is a not found font. How to?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T23:34:30+00:00Added an answer on June 11, 2026 at 11:34 pm

    MSDN says as following :

    For more information about how to construct fonts, see How to:
    Construct Font Families and Fonts. Windows Forms applications support
    TrueType fonts and have limited support for OpenType fonts. If you
    attempt to use a font that is not supported, or the font is not
    installed on the machine that is running the application, the
    Microsoft Sans Serif font will be substituted.

    You can check the if the font is correct by doing as following :

    var myFont = new Font(fontName)
    if (myFont.Name != fontName ) 
    { 
        throw new Exception()
    } 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: php if integer between a range? Let's say $num = 5; How
Possible Duplicate: JUnit test for System.out.println() Is it possible to check, through JUnit testing,
Possible Duplicate: Using jQuery to test if an input has focus I need to
Possible Duplicate: how to test php email using WAMP Hey everyone, First off I
Possible Duplicate: .NET file system wrapper library I would like to write a test
Possible Duplicate: Interesting test of Javascript RegExp Regular expression test can't decide between true
Possible Duplicate: How do I test for an empty Javascript object from JSON? var
Possible Duplicate: Calling Python from JavaScript I have a test.py and test.js . I
Possible Duplicate: Choose order to execute JUnit tests I am writing a JUnit test.
Possible Duplicate: What does 'unsigned temp:3' means struct Test { unsigned a : 5;

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.