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 8671235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T18:54:01+00:00 2026-06-12T18:54:01+00:00

When I draw text by DrawText function of Win32 API Is there a way

  • 0

When I draw text by DrawText function of Win32 API
Is there a way to determine which font will be used, or determine the font size, or bold, or italic?
PS I write in C#

  • 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-12T18:54:02+00:00Added an answer on June 12, 2026 at 6:54 pm

    As MSDN says,

    The DrawText function uses the device context’s selected font, text color, and background color to draw the text.

    Which means that you can obtain current font handle from the device context, and then obtain LOGFONT structure which provides you details about the font, that you requested.

    Since API is using currently selected font, to change it you need to have the new font handle available (you typically pre-create it, or otherwise get HFONT font handle using e.g. CreateFont or CreateFontIndirect API). Then prior to calling DrawText you replace current selected font with your own using SelectObject and once you are done you place the orignial font back with another SelectObject call.

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

Sidebar

Related Questions

I'm calling the Win32 DrawText function to output some text into a device context.
Is there any way to draw text in a DisplayObject or Shape using only
Is there a way to draw text in an NSBitMapImageRep with sub-pixel anti-aliasing? The
in php, is there an easy way to draw text with imagettftext and imagefilledarc
I would like to draw text on a canvas using the Canvas.drawText call for
when i draw text use DC, it always show an backgournd color which is
using the g.drawText function (two calls one for each text) is it possible to
I want to add new font and draw text on the screen. But When
Using the imagettftext function from the PHP GD library, one can only draw text
I'm trying to draw text without antialiasing on a canvas in Android. The font

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.