when printing to a pdf file I have a strange font issue.
Normally I could get the height of a font by coding oFont:nHeight.
So this is working:
- Code: Select all Expand view
- #include "FiveWin.ch"
REQUEST FWHARU
PROCEDURE Main()
//----------------
LOCAL oPrn, oFont
LOCAL cPdfFile := CurDrive() + ":\" + curdir() + "\print.pdf"
LOCAL nRow := 50
TPrinter():lUseHaruPDF := .t.
PRINT oPrn NAME "Testprint" PREVIEW
DEFINE FONT oFont NAME "Arial" SIZE 0, -10 OF oPrn
PAGE
oPrn:Say( nRow, 50, "Line one", oFont )
nRow += 1.2 * oFont:nHeight
oPrn:Say( nRow, 50, "Line two", oFont )
ENDPAGE
ENDPRINT
RELEASE FONT oFont
RETURN
But If I do the following
- Code: Select all Expand view
- #include "FiveWin.ch"
#define _HEIGHT 2 // value of font size array for height
REQUEST FWHARU // required for using HaruPdf
PROCEDURE Main()
//----------------
LOCAL oPrn, oFont
LOCAL cPdfFile := CurDrive() + ":\" + curdir() + "\print.pdf"
LOCAL nRow := 50
TPrinter():lUseHaruPDF := .t.
PRINT oPrn NAME "Testprint" PREVIEW FILE cPdfFile
DEFINE FONT oFont NAME "Arial" SIZE 0, -10 OF oPrn
PAGE
oPrn:Say( nRow, 50, "Line one", oFont )
nRow += 1.2 * oFont:nHeight
oPrn:Say( nRow, 50, "Line two", oFont )
ENDPAGE
ENDPRINT
RELEASE FONT oFont
RETURN
That gives me the error : "Class: 'ARRAY' has no exported method: NHEIGHT"
In this case I have to write nRow += 1.2 * oFont[ _HEIGHT ]
Why is the height value of the same font in different structures?
Regards,
Detlef