M
mylai911
Unregistered / Unconfirmed
GUEST, unregistred user!
下面程序C++ Builder的,照理是可以打印出长型的字体的,但是打印出来后却是标准的
比例字体,为什么?是不是 Borland的BUG呢?
#include <vcl.h>
#pragma hdrstop
#include <printers.hpp>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
Graphics::TFont *tf;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TPrinter *Prntr = Printer();
tf=new Graphics::TFont;
tf->Assign(Form1->Font);
PLOGFONT plf = (PLOGFONT) LocalAlloc(LPTR, sizeof(LOGFONT));
GetObject(tf->Handle,sizeof(plf),plf);
plf->lfHeight=-29;
plf->lfWidth=8;
tf->Handle=CreateFontIndirect(plf);
Prntr->Title="打印测试";
Prntr->begin
Doc();
Prntr->Canvas->Font->Assign(tf);
Prntr->Canvas->TextOut(25,25,"打印测试");
Prntr->Canvas->TextOut(25,125,"1234567890.tt");
Prntr->Canvas->TextOut(25,225,"abcdefghijklmnopqrstuvwxyz");
Prntr->EndDoc();
tf->Free();
}
//---------------------------------------------------------------------------
比例字体,为什么?是不是 Borland的BUG呢?
#include <vcl.h>
#pragma hdrstop
#include <printers.hpp>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
Graphics::TFont *tf;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
TPrinter *Prntr = Printer();
tf=new Graphics::TFont;
tf->Assign(Form1->Font);
PLOGFONT plf = (PLOGFONT) LocalAlloc(LPTR, sizeof(LOGFONT));
GetObject(tf->Handle,sizeof(plf),plf);
plf->lfHeight=-29;
plf->lfWidth=8;
tf->Handle=CreateFontIndirect(plf);
Prntr->Title="打印测试";
Prntr->begin
Doc();
Prntr->Canvas->Font->Assign(tf);
Prntr->Canvas->TextOut(25,25,"打印测试");
Prntr->Canvas->TextOut(25,125,"1234567890.tt");
Prntr->Canvas->TextOut(25,225,"abcdefghijklmnopqrstuvwxyz");
Prntr->EndDoc();
tf->Free();
}
//---------------------------------------------------------------------------