Page 1 of 1

Pdf hbhpdf

Posted: Sat Jan 21, 2012 9:03 am
by l3whmg
Hi everybody.
Is there someone who are using harbour/contrib/hbhpdf library? I need help related with external fonts loaded.

I'm using this line code (is a True Type Font - file name is .ttf ):

Code: Select all

cLoadedFont := HPDF_LoadTTFontFromFile( ::s_oHrPdf, cFileName, HPDF_TRUE )
where: <::s_oHrPdf> is the HPDF_New() object and <cFileName> is the .ttf file

Font is loaded, no errors are returned while loading, but text showed it's not the same: it's different.
In attachment, you can find a free ttf file; I used it to do experiments.

Many thanks in advance.

Best regards

Re: Pdf hbhpdf

Posted: Sat Jan 21, 2012 5:12 pm
by fprijatelj
Hi Luigi

I'am using HPDF, and it works OK.
Here is a sample:


// FOR EXTERNAL FONTS:
cFont:=HPDF_LoadTTFontFromFile(Pdf,"arial.ttf" ,HPDF_TRUE)
FoA :=HPDF_GetFont( Pdf, cFont ,"CP1250")

//FOR INTERNAL:
FoH :=HPDF_GetFont( Pdf, "Helvetica" ,"CP1250")
FoHB :=HPDF_GetFont( Pdf, "Helvetica-Bold" ,"CP1250")
FoT :=HPDF_GetFont( Pdf, "Times-Roman" ,"CP1250")
FoTB :=HPDF_GetFont( Pdf, "Times-Bold" ,"CP1250")

Use FoA,FoH,.... in code.

There is a problem with builtin courier (Adobe reader X 10 doesn't display national chars , while
sumatraPdf displays them well. So in case i need courier, i use external courier.ttf!)

BRGDS
Franček

Re: Pdf hbhpdf

Posted: Sun Jan 22, 2012 9:49 am
by l3whmg
Hi Franček
many thanks for your replay and help.
Now I will try with some Windows embedded font.
I read somewhere (HaruPdf docs if I remember well): the loaded font must have some characteristics (CMAP, UNICODE and so one): perhaps not every fonts have these.

Well, many thanks.

Cheers