#1 2011-06-10 13:11:26

Safetydan
Member
Registered: 2011-06-09
Posts: 4

Font Capabilities

Hello,

First of all thank you for creating and maintaining this tool, so far I have been very impressed with it!

In my perusal of the forums I have seen bits of information on the font capabilities of the PDF engine but nothing really specific so I was hoping to clear some things up.

I have not had much success with fonts using VCLCanvas like so:

PdfDoc.VCLCanvas.Font.Name := 'Wingdings';

Using the pdf canvas directly with SetFont works properly.

Am I doing something wrong?

Thanks

Offline

#2 2011-06-10 14:16:04

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,655
Website

Re: Font Capabilities

PdfDoc.VCLCanvas.Font.Name := 'Wingdings';

.... then you continue using the PdfDoc.VCLCanvas to draw, is it?

Without some more code sample, it's difficult to guess why it was not working as expected.

The better is to post here some small code snippet, to have steps to reproduce issue, and make corrections.

Offline

#3 2011-06-15 16:08:14

Safetydan
Member
Registered: 2011-06-09
Posts: 4

Re: Font Capabilities

Sorry for the lacking initial post.  My code is a bit complicated and I didn't want to post all of it or unravel it.  Of course my issue was hiding in the convolutions.  It was some outdated code that was mucking things up with setting the font incorrectly.

Anyhow, I wanted to come back and provide a little example of how I am using the tool.  This is part of a larger system that draws text and images to a TCanvas in the standard ways.  SynPDF drops in very nicely, all I have to do is set up the VCLCanvas and set it as the one to be drawn on.  smile

procedure InitPDF;
begin
    FPDF := TPDFDocumentGDI.Create;
    FPDF.CompressionMethod  := cmNone;  //For debugging
    FPDF.ScreenLogPixels := 96;
    FPDF.DefaultPageWidth := (FNoticeDef.PageWidth * 72) div 1000;  //We are working in thousands of an inch
    FPDF.DefaultPageHeight := (FNoticeDef.PageHeight * 72) div 1000;
    FPDF.DefaultPageLandscape := sameText(FNoticeDef.orientation,'landscape');
    FPDF.AddPage;

    Canvas := FPDF.VCLCanvas;
    Canvas.Font.Name := 'Courier New';
    Canvas.Font.Size := 10;
end;

Offline

Board footer

Powered by FluxBB