Pdf hbhpdf

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Pdf hbhpdf

Post 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
Attachments
alison.zip
font file
(23.59 KiB) Downloaded 328 times
Luigi from Italy
www.L3W.it
fprijatelj
Posts: 14
Joined: Wed Mar 10, 2010 4:09 pm

Re: Pdf hbhpdf

Post 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
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Pdf hbhpdf

Post 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
Luigi from Italy
www.L3W.it
Post Reply