Article View: borland.public.cppbuilder.nativeapi
Article #15179Re: One last easy printing question
From: Bob Gonder
Date: Fri, 18 Jul 2003 00:18
Date: Fri, 18 Jul 2003 00:18
35 lines
2436 bytes
2436 bytes
Anthony wrote: >From the research I have done and the examples I have found I thought the >following should work. But the font doesn't seem to change. > > LOGFONT lpLogFont; > HFONT hfont, hfontPrev; > ZeroMemory(&lpLogFont, sizeof(LOGFONT)); > strcpy(lpLogFont.lfFaceName, "Courier New"); > lpLogFont.lfWidth=5; > lpLogFont.lfHeight=5; > hfont = CreateFontIndirect(&lpLogFont); You probably don't fill in enough values. Or maybe 5x5 is too small. You might try this (from my code). // select font for lpp LinesPerPage printerDy =GetDeviceCaps(printerDC, VERTRES)/lpp; // select font for cpl CharsPerLine printerDx =GetDeviceCaps(printerDC, HORZRES)/cpl; printerFont= CreateFont( printerDy,printerDx, 0, // angle of escapement 0, // base-line orientation angle FW_NORMAL, // font weight FALSE, // italic attribute flag FALSE, // underline attribute flag FALSE, // strikeout attribute flag OEM_CHARSET, // character set identifier OUT_TT_PRECIS, // output precision CLIP_DEFAULT_PRECIS, // clipping precision printer_quality == 'D'?DRAFT_QUALITY:PROOF_QUALITY, // output quality FIXED_PITCH+FF_MODERN, // pitch and family NULL // pointer to typeface name );
Technical Details
Message-ID:
<goeehvgpm7quqs6mgn53en5equ633ifurq@4ax.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!rip!news.webusenet.com!peer01.cox.net!cox.net!kibo.news.demon.net!demon!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<3f161c85@newsgroups.borland.com> <3f16278d$1@newsgroups.borland.com> <3f16fde7$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10cc67,9d1c7af093dd4f5b X-Google-Attributes: gid10cc67,public X-Google-ArrivalTime: 2003-07-17 17:39:30 PST From: Bob Gonder <notbg@notmindspring.invalid> Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: One last easy printing question Date: Thu, 17 Jul 2003 17:18:07 -0700 Organization: MindSpring Enterprises, Inc. Reply-To: notbg@notmindspring.invalid Message-ID: <goeehvgpm7quqs6mgn53en5equ633ifurq@4ax.com> References: <3f161c85@newsgroups.borland.com> <3f16278d$1@newsgroups.borland.com> <3f16fde7$1@newsgroups.borland.com> X-Newsreader: Forte Agent 1.91/32.564 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 67.31.164.101 X-Trace: newsgroups.borland.com 1058487481 67.31.164.101 (17 Jul 2003 17:18:01 -0700) Lines: 36 Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-09!supernews.com!64.152.100.70.MISMATCH!sjc70.webusenet.com!rip!news.webusenet.com!peer01.cox.net!cox.net!kibo.news.demon.net!demon!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail