🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15168

Re: One last easy printing question

#15168
From: Anthony
Date: Thu, 17 Jul 2003 19:43
46 lines
2322 bytes

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.

  Printer()->PrinterIndex = index;
  Printer()->GetPrinter(cDevice, cDriver, cPort, hDeviceMode );
  *HPrinterDC = CreateDC(NULL, cDevice, NULL, NULL);

  LOGFONT lpLogFont;
  HFONT hfont, hfontPrev;
  ZeroMemory(&lpLogFont, sizeof(LOGFONT));

  strcpy(lpLogFont.lfFaceName, "Courier New");
  lpLogFont.lfWidth=5;
  lpLogFont.lfHeight=5;
  hfont = CreateFontIndirect(&lpLogFont);
  hfontPrev = SelectObject(HPrinterDC, hfont);

Any suggestions?

TIA
Anthony


"Remy Lebeau (TeamB)" <gambit47@yahoo.com> wrote in message
news:3f16278d$1@newsgroups.borland.com...
>
> "Anthony" <awhitesell@attbi.com> wrote in message
> news:3f161c85@newsgroups.borland.com...
>
> > All I have left to convert is the following three lines:
> >
> >       Printer()->Canvas->Pen->Color=clBlack;
> >       Printer()->Canvas->Font->Name="Courier New";
> >       Printer()->Canvas->Font->Size=10;
> >
> > Does any one know how to do these with API function calls?
>
> Use SelectObject() to select  HPEN and HFONT objects into the Canvas's
HDC.
> Also look at SetROP2() for the Pen and SetTextColor() for the Font.
>
>
> Gambit
>
Technical Details
Message-ID: <3f16fde7$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!news.he.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <3f161c85@newsgroups.borland.com> <3f16278d$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 13:03:00 PST
From: "Anthony" <awhitesell@attbi.com>
Newsgroups: borland.public.cppbuilder.nativeapi
References: <3f161c85@newsgroups.borland.com> <3f16278d$1@newsgroups.borland.com>
Subject: Re: One last easy printing question
Date: Thu, 17 Jul 2003 15:43:11 -0400
Lines: 48
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1106
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106
NNTP-Posting-Host: 24.128.134.183
Message-ID: <3f16fde7$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1058471399 24.128.134.183 (17 Jul 2003 12:49:59 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!news.tele.dk!news.tele.dk!small.news.tele.dk!news.he.net!news-hog.berkeley.edu!ucberkeley!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail