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

    Fonts condensed while Printing

    I use CFont::CreateFont or CFont::CreatePointFont to create my objects. My problem is happening only while printing or print previewing : all my strings appear condensed (and in debug mode I get an assertion fault).
    Any idea anyone?


  2. #2
    Join Date
    Apr 1999
    Posts
    5

    Re: Fonts condensed while Printing

    use this code to change you font

    CFont police;
    TEXTMETRIC tm;

    police.DeleteObject ();

    long ht = MulDiv(Size, pDC->GetDeviceCaps (VERTSIZE), 72);

    police.CreateFont ( ht , 0, 0, 0, int(ParamText->font.Weight), int(ParamText->font.Italic),
    int (ParamText->font.Underlined), 0,
    ANSI_CHARSET, OUT_DEFAULT_PRECIS,
    CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY,
    DEFAULT_PITCH | FF_MODERN, ParamText->font.Name);
    pDC->SelectObject (police);
    pDC->GetTextMetrics(&tm);

    police.DeleteObject ();



    Size it the size like word or excel (10, 12, 16...) and you can retreive the format of font by structure TEXTMETRIC

    chrisstophe


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