CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Location
    Bangalore India.
    Posts
    7

    text to fit in rectangle...

    How do i calculate the font so that
    text fits in the given rectangle ??

    I mean how do i fill the LOGFONT
    structure so that text fits into a
    given rectangle ?

    Text should get resized ...
    it should not clipped.


  2. #2
    Join Date
    Apr 1999
    Posts
    383

    Re: text to fit in rectangle...

    Use check the text extent CDC::GetTextExtent() or CDC::GetOutputTextExtent(), setting different font sizes until it fits the available width. You can also use CDC:rawText to wrap text within a rectangle...

    Dave


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured