Underline and italic in PDF seems not work

Moderator: Rathinagiri

User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Underline and italic in PDF seems not work

Post by Pablo César »

I have changed output file of "UsedFonts.txt" to "UsedFonts.html", in order to visualizate in different colors. So I included new functions as:

HTML_TABLE_INI (nHandle,cTit,nWidth,nPading)
HTML_TABLE_LINE (nHandle,aLin)
HTML_BOLD (nHandle,cText)
HTML_END (nHandle)

These functions made a TABLE in HTML. Now I show the source fonts for avaliable and to be included for next relase. Ok Mr. Rathinagiri ?

I hope be enjoyed ! :)
Attachments
HFCL_SOURCE.rar
(9.81 KiB) Downloaded 358 times
HFCL_SAMPLES.rar
(2.76 MiB) Downloaded 363 times
hfcl_include.rar
(4.66 KiB) Downloaded 348 times
HFCL_DOC.rar
(286.48 KiB) Downloaded 367 times
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Underline and italic in PDF seems not work

Post by Javier Tovar »

Gracias Pablo César por tu esfuerzo y compartirlo!

Saludos
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Underline and italic in PDF seems not work

Post by Pablo César »

Gracias Javier por demonstrar tu interés en el asunto.
Te gustó como quedó el html ?
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Javier Tovar
Posts: 1275
Joined: Tue Sep 03, 2013 4:22 am
Location: Tecámac, México

Re: Underline and italic in PDF seems not work

Post by Javier Tovar »

Hola Pablo César,

Claro que si Pablo, ya no se ven las lineas punteadas, ahora se ve muy profesional! :D :D :D

Gracias por compartir!
Italia1
Posts: 60
Joined: Mon Mar 24, 2014 10:55 am
Location: Italia

Re: Underline and italic in PDF seems not work

Post by Italia1 »

Sorry for the delay. Problems with PC.

MEGA Great :D :D ! Thanks so much for BOLD and ITALIC! I test tomorrow. For UNDERLINE we think together a solution.

Code: Select all

#include "hfcl.ch"
// #Include "hmg_hpdf.ch" (Not need any more at your PRGS)
I've always used hmg_hpdf so I've programs with many lines with SELECT PRINTER, PRINTDOC, PRINT, PRINTPAGE.
It's possible to change hfcl_hmg_hpdf.ch or create new #command to recreate those controls?

example

Code: Select all

#xcommand SELECT PRINTER <cPDFFile> ;
	[ <lOrientation 	: ORIENTATION>		<nOrientation> ] ;
	[ <lPaperSize		: PAPERSIZE>		<nPaperSize> ]   ;
	[ <lPaperLength 	: PAPERLENGTH>		<nPaperLength> ] ;
	[ <lPaperWidth		: PAPERWIDTH>		<nPaperWidth> ]  ;
	[ <Log    		    : LOG>	]         ;
=> ;
	_HMG_HPDF_INIT ( <cPDFFile>, if ( <.lOrientation.>	, <nOrientation> , 1 ) , if ( <.lPaperSize.> , <nPaperSize>	, 1 ) , if ( <.lPaperLength.> , <nPaperLength> , -999 ) , if ( <.lPaperWidth.> , <nPaperWidth> , -999 ) , <.Log.> )
With hfcl (or hfcl_hmg_hpdf.ch) i can print Euro Sign in a text?

Code: Select all

var1:=test->note	// "I would like print € (euro) sign in PDF"
@ 20,20 PRINT var1
I test with "old" hmg_hpdf.ch with
SET PRINTDOC ENCODING TO "WinAnsiEncoding"
or
SET PRINTDOC ENCODING TO "FontSpecific"
but nothing.

HMGFORUM: a great forum with great and professional international members!

Thank you for existing! :D

Edit: I look HB_UTF8TOSTR :?:
I use the great HMG3.2(stable). Have i nice international HMG to everyone!
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Underline and italic in PDF seems not work

Post by Pablo César »

Italia1 wrote:MEGA Great :D :D ! Thanks so much for BOLD and ITALIC! I test tomorrow. For UNDERLINE we think together a solution.
Glad you liked it, hope it will be very useful to you and many others too.

Code: Select all

#include "hfcl.ch"
// #Include "hmg_hpdf.ch" (Not need any more at your PRGS)
I've always used hmg_hpdf so I've programs with many lines with SELECT PRINTER, PRINTDOC, PRINT, PRINTPAGE.
No problem at all. you can still use it, but is not necessary because it is being included in HFCL. This library belongs to hfcl, this MUST be include.
It's possible to change hfcl_hmg_hpdf.ch or create new #command to recreate those controls?
Many ressource, different libraries. I do not think good idea to include ALL in one. But probably hfcl must be included as part of HMG libraries (not separated) like as BosTaurus library. But this decision it is not mine.
Italia1 wrote:example

Code: Select all

#xcommand SELECT PRINTER <cPDFFile> ;
	[ <lOrientation 	: ORIENTATION>		<nOrientation> ] ;
	[ <lPaperSize		: PAPERSIZE>		<nPaperSize> ]   ;
	[ <lPaperLength 	: PAPERLENGTH>		<nPaperLength> ] ;
	[ <lPaperWidth		: PAPERWIDTH>		<nPaperWidth> ]  ;
	[ <Log    		    : LOG>	]         ;
=> ;
	_HMG_HPDF_INIT ( <cPDFFile>, if ( <.lOrientation.>	, <nOrientation> , 1 ) , if ( <.lPaperSize.> , <nPaperSize>	, 1 ) , if ( <.lPaperLength.> , <nPaperLength> , -999 ) , if ( <.lPaperWidth.> , <nPaperWidth> , -999 ) , <.Log.> )
This suggestion, do you think is better to pass last parameter as logic type ? Well I tried but I do not found the right way. Seems (in include files) that logical types requires more elaboration. Why are you asking this, this parameter is optional and you can used sometimes, not always.
With hfcl (or hfcl_hmg_hpdf.ch) i can print Euro Sign in a text?

Code: Select all

var1:=test->note	// "I would like print € (euro) sign in PDF"
@ 20,20 PRINT var1
I test with "old" hmg_hpdf.ch with
SET PRINTDOC ENCODING TO "WinAnsiEncoding"
or
SET PRINTDOC ENCODING TO "FontSpecific"
but nothing.

Edit: I look HB_UTF8TOSTR :?:
Remember, this library works ONLY with true types fonts. I believe Euro sign is newer that true type fonts, probably all fonts found in Windows does not exist the euro sign (I think so). Probably you will need to find one true type font, which have been re-edited or having euro sign. I can not found here, links are crashing now in my internet now. So try this: http://www.myfonts.com/Article.html may you will find.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Italia1
Posts: 60
Joined: Mon Mar 24, 2014 10:55 am
Location: Italia

Re: Underline and italic in PDF seems not work

Post by Italia1 »

Pablo César wrote:
Italia1 wrote:MEGA Great :D :D ! Thanks so much for BOLD and ITALIC! I test tomorrow. For UNDERLINE we think together a solution.
Glad you liked it, hope it will be very useful to you and many others too.
Hello! I try compile demo2.prg: make demo2.exe but not make PDF. Your demo2.exe make PDF correctly: what I wrong?

For #command i try tomorrow some tests and post results here. Thank you for your precious opinions! Your opinions is extremely important for me!
Pablo César wrote:
With hfcl (or hfcl_hmg_hpdf.ch) i can print Euro Sign in a text?

Code: Select all

var1:=test->note	// "I would like print € (euro) sign in PDF"
@ 20,20 PRINT var1
I test with "old" hmg_hpdf.ch with
SET PRINTDOC ENCODING TO "WinAnsiEncoding"
or
SET PRINTDOC ENCODING TO "FontSpecific"
but nothing.

Edit: I look HB_UTF8TOSTR :?:
Remember, this library works ONLY with true types fonts. I believe Euro sign is newer that true type fonts, probably all fonts found in Windows does not exist the euro sign (I think so). Probably you will need to find one true type font, which have been re-edited or having euro sign. I can not found here, links are crashing now in my internet now.
I remember that Euro is inserted in almost all the fonts in Windows (I remember as update). I try this solution that's it's ok for me:

Code: Select all

SET PRINTDOC ENCODING TO "WinAnsiEncoding"
wrong:=test->note        // character field
witheuro:=STRTRAN(wrong, chr(226)+chr(130)+chr(172), chr(128))
chr(128) is a Euro Sign in my PC with XP Home OEM and put it correctly in PDF.

I don't know why Euro € in DBF is changed in 3 chars (266 130 172) but for me is the solution. In HMG-IDE, Windows Notepad and in my compiled textbox I found € Sign nor 3 chars. Only in PDF I find (before my solution) 3 chars. I hope it's useful to others.

Bye bye :D
I use the great HMG3.2(stable). Have i nice international HMG to everyone!
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Underline and italic in PDF seems not work

Post by Pablo César »

Italia1 wrote:I try compile demo2.prg: make demo2.exe but not make PDF. Your demo2.exe make PDF correctly: what I wrong?
You tried to re-build the hmg_hpdf ?
In my previous posts I put such modifications would be available in the next update of HMG. But as I have not got any feedback from Rathinagiri on this subject, I made available the source to the public can evaluate and see if such modifications are approved and wish to be included for the new release or not.

For those who want to use and even take tests, must redo the library.
Italia1 wrote:I remember that Euro is inserted in almost all the fonts in Windows (I remember as update). I try this solution that's it's ok for me:

Code: Select all

SET PRINTDOC ENCODING TO "WinAnsiEncoding"
wrong:=test->note        // character field
witheuro:=STRTRAN(wrong, chr(226)+chr(130)+chr(172), chr(128))
chr(128) is a Euro Sign in my PC with XP Home OEM and put it correctly in PDF.
Yesterday I was not much able to access with good performance to internet. I will check this about ansi fonts, true types fonts and also SET PRINTDOC ENCODING commands I will make some test with euro sign at hmg_hpdf. Please wait I shall revert this matter again.
Italia1 wrote:I don't know why Euro € in DBF is changed in 3 chars (266 130 172) but for me is the solution. In HMG-IDE, Windows Notepad and in my compiled textbox I found € Sign nor 3 chars. Only in PDF I find (before my solution) 3 chars. I hope it's useful to others.
Probably by the same reason that in DBF is not written in UNICODE and euro sign need to be in UNICODE format.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Underline and italic in PDF seems not work

Post by Pablo César »

Italia1 wrote:I remember that Euro is inserted in almost all the fonts in Windows (I remember as update). I try this solution that's it's ok for me:

Code: Select all

SET PRINTDOC ENCODING TO "WinAnsiEncoding"
What I could see for at begining the right command is:

SET HPDFDOC ENCODING TO

This command is for hmg_harupdf and you will find at C:\HMG.3.2\hfcl\Include\hfcl_hmg_hpdf.ch
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Italia1
Posts: 60
Joined: Mon Mar 24, 2014 10:55 am
Location: Italia

Re: Underline and italic in PDF seems not work

Post by Italia1 »

Pablo César wrote:
Italia1 wrote:I try compile demo2.prg: make demo2.exe but not make PDF. Your demo2.exe make PDF correctly: what I wrong?
You tried to re-build the hmg_hpdf ?
In my previous posts I put such modifications would be available in the next update of HMG. But as I have not got any feedback from Rathinagiri on this subject, I made available the source to the public can evaluate and see if such modifications are approved and wish to be included for the new release or not.

For those who want to use and even take tests, must redo the library.
I never re-build a lib :oops: I try to put new HMG_HPDF.PRG file in project but

Code: Select all

fatal error: hpdfcfg.h: No such file or directory - compilation terminated.
Tomorrow I try the various batch files (such as hmg.3.2\HFCL\Source\buildlib.bat) and see what's happens (backup my HMG original dirctory :mrgreen: ).

Thanks for help. Bye bye. :D
Last edited by Italia1 on Wed Apr 16, 2014 5:19 pm, edited 2 times in total.
I use the great HMG3.2(stable). Have i nice international HMG to everyone!
Post Reply