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

  • SEARCH
  • Home
  • 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 7185495
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:25:39+00:00 2026-05-28T18:25:39+00:00

I am drawing some text with Gdi+ and I’m trying to make sure the

  • 0

I am drawing some text with Gdi+ and I’m trying to make sure the Font I create actually exists. I noticed that it was working no matter what font I specified. I have the following code:

Font font(TEXT("SomeGibberishFOEIHSFUE"), 12, 0, UnitPoint);

if (!font.IsAvailable())
    exit(0);

// draw text

I have no font installed on my system called SomeGibberishFOEIHSFUE, but IsAvailable returns TRUE and the program runs and draws the text with a font that looks like Arial instead of exiting. Why is this?

If I am using IsAvailable wrong, what function should I use to tell whether the creation of a Font succeeded or not? I have also tried GetLastStatus which returns Ok.

  • 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-05-28T18:25:40+00:00Added an answer on May 28, 2026 at 6:25 pm

    That’s the Windows font mapper at work, it will always find a substitute font if it cannot supply the requested one. Falling back to the default GUI font if necessary. You could use the FontFamily class instead. The .NET version of it (looks like you’re using it) will throw an ArgumentException when you use its constructor and pass a non-existing font. The native GDI+ version of it has an IsAvailable() method. Yes, kinda screwy behavior but that’s not unusual in GDI+.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to create a CellTable that has a column with some text
I create a custom image view by extending ImageView that just draws some text
I'm trying to include some formatted text as part of a drawing in XAML.
I'm trying to draw some text onto an MapView on Android. The drawing of
I'm drawing some graphics and text with GDI in my CScrollView. I need to
I am trying to do some drawing with android. I have an audioplayer, which
I'm having some strange drawing artefacts that I'm hoping someone might be able to
I need a control that allows loading a picture, performing some basic drawing tasks
I am custom drawing some text: point = CGPointMake(77, 5); [[message valueForKey:@user_login] drawAtPoint:point forWidth:200
I have an image and after drawing some features(ellipses and text) on it I

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.