You are not logged in.
Pages: 1
All,
I am totally lost. Could I please get some sample code for rotating text. If I could figure out how to use a logfont I could go from there.
Thanks,
Les
Offline
Just rotate text properties when adding it in the TMetaFileCanvas, at GDI commands level.
See e.g. http://delphi.about.com/cs/adptips1999/ … 0999_2.htm
Offline
I am still failing at assigning the font. I am trying:
var
lPdf : TPdfDocumentGDI;
lPage : TPdfPage;
LogFont :TLogFont;
tf :tFont;
begin
lPdf := TPdfDocumentGDI.Create;
lPage := lPDF.AddPage;
{
otherworking code here
}
tf := tFont.Create;
tf.Assign(Form1.Canvas.Font) ;
GetObject(tf.Handle, sizeof(LogFont), @LogFont) ;
LogFont.lfEscapement := 315 * 10;
LogFont.lfOrientation := 315 * 10;
tf.Handle := CreateFontIndirect(LogFont) ;
lPDF.Canvas.Page.Font.Assign(tf);
Up to the point where I try to create the rotated font all is well.
I can write text using:
lPDF.Canvas.TextOut(xe, ye, 'MINUTES');
And draw lines using:
lPDF.Canvas.MoveTo(GraphLeft,ye);
lPDF.Canvas.LineTo(GraphRight,ye);
lPDF.Canvas.Stroke;
The code compiles, but when it tries to assign the font, I get:
'Cannot assign a tFont to a tPDFFontTrueType' error message.
Any additional help would be greatly appreciated.
Les
Offline
Thanks all, I have resolved the issue using vcl canvas.
Les
Offline
Pages: 1