Page 1 of 1
print color fonts
Posted: Wed Aug 29, 2018 10:53 am
by jds
How can I, for example, in the following definition, incorporate the Color of a font (f.e. CLR_RED,...)
>DEFINE FONT oFont NAME 'ARIAL NARROW' SIZE 0,-9 OF oPrn
Thanks
José
Re: print color fonts
Posted: Wed Aug 29, 2018 12:00 pm
by Enrico Maria Giordano
You can't. You have to use a PEN.
EMG
Re: print color fonts
Posted: Wed Aug 29, 2018 1:20 pm
by ellano
unless you want to do this afterwards:
Code: Select all
oReport:SAY(line, 5*nColumn,ALLTRIM(MyDB->MyField), oFont, ,CLR_HGREEN)
Emiliano Llano Díaz
Re: print color fonts
Posted: Wed Aug 29, 2018 2:21 pm
by jds
Thank you Ellano, it works !!
Re: print color fonts
Posted: Wed Aug 29, 2018 3:40 pm
by jds
Dear Ellano,
With your solution I can print fonts in any color but once I utilize a color font (for example in a do while not eof() ) the rest of records are printed in this color even if I program a condition (if else endif) to print some records of the do while in black color ?
Can you explain me what to do?
Thanks
Re: print color fonts
Posted: Wed Aug 29, 2018 10:07 pm
by nageswaragunupudi
Code: Select all
#include "fivewin.ch"
function Main()
local oPrn, oFont, nRow
local aColors := { CLR_HRED, CLR_GREEN, CLR_BLACK }
USE STATES
PRINT oPrn PREVIEW
DEFINE FONT oFont NAME "VERDANA" SIZE 0,-20 BOLD OF oPrn
PAGE
nRow := 2
do while RECNO() <= 20 .and. !eof()
@ nRow, 1 PRINT TO oPrn TEXT FIELD->NAME SIZE 5 INCHES ;
FONT oFont COLOR aColors[ ( RECNO() % 3 ) + 1 ] ;
LASTROW nRow
SKIP
enddo
ENDPAGE
ENDPRINT
RELEASE FONT oFont
CLOSE STATES
return nil
Re: print color fonts
Posted: Thu Aug 30, 2018 6:21 am
by jds
Thank you very much to all of you, problem solved !
Kind regards
José