HPDFPRINT with Font cannot be loaded
Moderator: Rathinagiri
HPDFPRINT with Font cannot be loaded
Dear Masters & Friends,
i try to load the ttf font :
[img]d:\test\tscparan_TTF.JPG[/img]
but i get this :
[img]fontcannotbeloaded.JPG[/img]
What am i doing wrong ?
Pls help !
Thks n rgds
Chang
i try to load the ttf font :
[img]d:\test\tscparan_TTF.JPG[/img]
but i get this :
[img]fontcannotbeloaded.JPG[/img]
What am i doing wrong ?
Pls help !
Thks n rgds
Chang
- Attachments
-
- tscparan_TTF.JPG (115.02 KiB) Viewed 13397 times
Just Hmg It !
Re: HPDFPRINT with Font cannot be loaded
this is what i get : error !
- Attachments
-
- fontcannotbeloaded.JPG (12.47 KiB) Viewed 13396 times
-
- fontcannotbeloaded.JPG (12.47 KiB) Viewed 13396 times
Just Hmg It !
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
HPDFPRINT with Font cannot be loaded
It is something quite difficult to guess what is happen without your code !
Probably your font file isn't in current folder. Try to put the FULL path.
Probably your font file isn't in current folder. Try to put the FULL path.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Re: HPDFPRINT with Font cannot be loaded
ok Sir, pls find my ssw,
Code: Select all
#include <hmg.ch>
#include "hfcl.ch"
Function Main
MEMVAR _HMG_SYSDATA
Load Window Main
Main.Center
Main.Activate
Return NIL
FUNCTION ssw_HPdfPrint( cTtf)
LOCAL aLine, aFont
LOCAL cString, cFontname, cPdfname, cStartupFolder
LOCAL nI
LOCAL lSuccess
HB_DEFAULT( @cTtf, '')
cString := MEMOREAD( "List.TXT")
aLine := HB_ATOKENS( cString, CRLF)
lSuccess := .F.
IF EMPTY( cTtf)
aFont := GetFont()
cFontname := aFont[ 1]
ELSE
// cFontname := "MS LineDraw.TTF"
// cFontname := "tahoma.TTF"
// cFontname := "times.TTF"
cFontname:= "cour.TTF"
ENDIF
cPdfName := "ssw_" + STRTRAN( cFontname, ".TTF", "_TTF") + ".pdf"
SELECT HPDFDOC cPdfname TO lSuccess papersize HPDF_PAPER_A4
SET HPDFDOC COMPRESS ALL
SET HPDFDOC PAGEMODE TO OUTLINE
SET HPDFINFO AUTHOR TO 'S. Rathinagiri'
SET HPDFINFO CREATOR TO 'S. Rathinagiri'
SET HPDFINFO TITLE TO 'ssw HPDF Print'
SET HPDFINFO SUBJECT TO 'Test HPdfPrint for Load Font'
SET HPDFINFO KEYWORDS TO 'HMG, HPDF, Documentation, LibHaru, Harbour, MiniGUI'
SET HPDFINFO DATECREATED TO date() TIME time()
IF lSuccess
START HPDFDOC
START HPDFPAGE
FOR nI := 1 TO LEN( aLine)
@ 10 + nI * 5, 10 HPDFPRINT aLine[ nI] FONT cFontname
NEXT
END HPDFPAGE
END HPDFDOC
MsgInfo( "Pdf Printed !")
ELSE
MsgInfo( "Error Printing Pdf !")
ENDIF
RETURN NIL
- Attachments
-
- error.JPG (27.59 KiB) Viewed 13321 times
Just Hmg It !
Re: HPDFPRINT with Font cannot be loaded
Hola hmgchang
Pudiera ser esta la razon ?
viewtopic.php?f=5&t=3422&p=31430#p31430
-------------------------------------------------------------------------------
Hello hmgchang
Could this be the reason ?
viewtopic.php?f=5&t=3422&p=31430#p31430
Pudiera ser esta la razon ?
viewtopic.php?f=5&t=3422&p=31430#p31430
-------------------------------------------------------------------------------
Hello hmgchang
Could this be the reason ?
viewtopic.php?f=5&t=3422&p=31430#p31430
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: HPDFPRINT with Font cannot be loaded
Hi Andy,
I actually tried to load the Courier font ( Cour.TTF).
I dont know if i hv done something wrong, pls advise
thks n rgds
Chang
I actually tried to load the Courier font ( Cour.TTF).
I dont know if i hv done something wrong, pls advise
thks n rgds
Chang
Just Hmg It !
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: HPDFPRINT with Font cannot be loaded
There is a fix in the next version of HMG. I am sure it will solve this problem.
For the time being, try to give the full path of the font file.
For the time being, try to give the full path of the font file.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
- Pablo César
- Posts: 4059
- Joined: Wed Sep 08, 2010 1:18 pm
- Location: Curitiba - Brasil
HPDFPRINT with Font cannot be loaded
Yeah, as I have already told him...Rathinagiri wrote:For the time being, try to give the full path of the font file.
Only in the new version is going to find the ttf file. Is necessary to know where the file is. If is not in current folder, will not find. And I think even been in current, will need the fullpath of ttf file.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
-
- Posts: 683
- Joined: Tue Jun 04, 2013 6:33 pm
- Location: Argentina
Re: HPDFPRINT with Font cannot be loaded
Hi Chang:
I use this procedure to load ttf fonts, and all works fine.-
1) First define at the begining of the function pdf_create include these variables
function pdf_create
local lSuccess := .f.
local cLB := chr( 10 )
local cTTFFName, cFontName, qPDF
2) Before each line HPDFPRINT where you want an special font put:
qPDF := _HMG_SYSDATA[ 150, 1 ]
cTTFFName := "C:\VEGANO\KUNSTLER.ttf"
cFontName := HPDF_LoadTTFontFromFile( qPDF, cTTFFName, .F. )
@ 235, 200 HPDFPRINT "This is right aligned text" FONT cFontName SIZE 30 RIGHT
Notes:
cTTFFName stores folder where is the font file.-
cFontName stores the full name of the font
For simplicity i keep the fonts i use on the principal folder of my develope.-
I hope this will let you solve your problem.-
With regards.
Eduardo
I use this procedure to load ttf fonts, and all works fine.-
1) First define at the begining of the function pdf_create include these variables
function pdf_create
local lSuccess := .f.
local cLB := chr( 10 )
local cTTFFName, cFontName, qPDF
2) Before each line HPDFPRINT where you want an special font put:
qPDF := _HMG_SYSDATA[ 150, 1 ]
cTTFFName := "C:\VEGANO\KUNSTLER.ttf"
cFontName := HPDF_LoadTTFontFromFile( qPDF, cTTFFName, .F. )
@ 235, 200 HPDFPRINT "This is right aligned text" FONT cFontName SIZE 30 RIGHT
Notes:
cTTFFName stores folder where is the font file.-
cFontName stores the full name of the font
For simplicity i keep the fonts i use on the principal folder of my develope.-
I hope this will let you solve your problem.-
With regards.
Eduardo