Hi!
Maybe stupid question, but I need to print data with optionally declared BOLD, ITALIC, UNDERLINE
eg.
@ prow, pcol PRINT cText FONT "ARIAL" SIZE 12 if(lBold, BOLD,) if (lItalic, ITALIC,) if (lUnderline, UNDERLINE,)
How I must code it to work?
printing optionally BOLD, ITALIC, UNDERLINE
Moderator: Rathinagiri
Re: printing optionally BOLD, ITALIC, UNDERLINE
Look at i_print.ch Maybe this will be useful:
Code: Select all
#xtranslate @ <Row> , <Col> PRINT [ DATA ] <cText> ;
[ <lfont : FONT> <cFontName> ] ;
[ <lsize : SIZE> <nFontSize> ] ;
[ <bold : BOLD> ] ;
[ <italic : ITALIC> ] ;
[ <underline : UNDERLINE> ] ;
[ <strikeout : STRIKEOUT> ] ;
[ <lcolor : COLOR> <aColor> ] ;
[ <align:CENTER,RIGHT> ] ;
[ ANGLE <nAngleInDegrees> ] ;
=> ;
iif( _HMG_SYSDATA \[ 513 \],;
_HMG_HPDF_PRINT ( <Row> , <Col> , <cFontName> , <nFontSize> , <aColor>\[1\] , <aColor>\[2\] , <aColor>\[3\] , <cText> , <.bold.> , <.italic.> , <.underline.> , <.strikeout.> , <.lcolor.> , <.lfont.> , <.lsize.> , <"align"> ),;
_HMG_PRINTER_H_PRINT ( _HMG_SYSDATA \[ 374 \] , <Row> , <Col> , <cFontName> , <nFontSize> , <aColor>\[1\] , <aColor>\[2\] , <aColor>\[3\] , <cText> , <.bold.> , <.italic.> , <.underline.> , <.strikeout.> , <.lcolor.> , <.lfont.> , <.lsize.> , <"align"> , <nAngleInDegrees> ) )
Last edited by edk on Wed Oct 18, 2017 10:47 am, edited 1 time in total.
Re: printing optionally BOLD, ITALIC, UNDERLINE
Yes, Edward.
I'm modifying PRINT command to get acceptable result
I'm modifying PRINT command to get acceptable result
Re: printing optionally BOLD, ITALIC, UNDERLINE
I've modified PRINT command translation to XPRINT:
Then I can print my data with optional BOLD, ITALIC, UNDERLINE, STRIKEOUT and ALIGNED:
MULTILINE PRINTING can be modified in the same way.
I hope, this solution will be useful for someone
Code: Select all
#xtranslate @ <Row> , <Col> XPRINT [ DATA ] <cText> ;
[ <lfont : FONT> <cFontName> ] ;
[ <lsize : SIZE> <nFontSize> ] ;
[ XBOLD <xbold> ] ;
[ XITALIC <xitalic> ] ;
[ XUNDERLINE <xunderline> ] ;
[ XSTRIKEOUT <xstrikeout> ] ;
[ <lcolor : COLOR> <aColor> ] ;
[ XALIGN <align> ] ;
[ ANGLE <nAngleInDegrees> ] ;
=> ;
iif( _HMG_SYSDATA \[ 513 \],;
_HMG_HPDF_PRINT ( <Row> , <Col> , <cFontName> , <nFontSize> , <aColor>\[1\] , <aColor>\[2\] , <aColor>\[3\] , <cText> , <xbold> , <xitalic> , <xunderline> , <xstrikeout> , <.lcolor.> , <.lfont.> , <.lsize.> , <align> ),;
_HMG_PRINTER_H_PRINT ( _HMG_SYSDATA \[ 374 \] , <Row> , <Col> , <cFontName> , <nFontSize> , <aColor>\[1\] , <aColor>\[2\] , <aColor>\[3\] , <cText> , <xbold> , <xitalic> , <xunderline> , <xstrikeout> , <.lcolor.> , <.lfont.> , <.lsize.> , <align> , <nAngleInDegrees> ) )
Code: Select all
lBold := .t.
lItalic := .f.
lUnderline := .f.
cAlignment := "CENTER"
@ pRow , pcol XPRINT "some text to print" ;
FONT "ARIAL CE" SIZE nFontSize COLOR BLACK;
XBOLD lBold ;
XITALIC lItalic ;
XUNDERLINE lUnderline ;
XALIGN cAlignment
MULTILINE PRINTING can be modified in the same way.
I hope, this solution will be useful for someone
Last edited by mol on Wed Oct 18, 2017 11:03 am, edited 1 time in total.
Re: printing optionally BOLD, ITALIC, UNDERLINE
Brawo TY usuń ] z cAlignment]
- serge_girard
- Posts: 3166
- Joined: Sun Nov 25, 2012 2:44 pm
- DBs Used: 1 MySQL - MariaDB
2 DBF - Location: Belgium
- Contact:
Re: printing optionally BOLD, ITALIC, UNDERLINE
Very usefull ! Thanks.
Serge
Serge
There's nothing you can do that can't be done...