FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour EXCESS RELEASE OF FONT
Posts: 1516
Joined: Thu May 27, 2010 02:06 PM
Re: EXCESS RELEASE OF FONT ( solucionado )
Posted: Mon Jan 19, 2015 09:51 PM

mas aún si dejo la linea así:

REDEFINE GET aObj[vNOMCLI] VAR aVAr[vNOMCLI] ID IDNOMCLI OF oDlg PICTURE "@!" // FONT ofont2 UPDATE

no da error .

REDEFINE GET aObj[vNOMCLI] VAR aVAr[vNOMCLI] ID IDNOMCLI OF oDlg PICTURE "@!" FONT ofont2 UPDATE
asi si da error .

Creo que el problema va a estar en la clase get que se enlaza que no sera la de fwh y no estará actualizada....

------------ edito -------------
Listo solucionado ... estaba enlazada una clase get que no estaba actualizada.
Queda pendiente de completar la signacion de fonts en el define de tdatepick .
yo creo que el código correcto seria el propuesto por cristobal :

if oFont = nil
::SetFont( oWnd:oFont )
else
::SetFont( oFont )
endif

Gracias a todos por la ayuda .

Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: EXCESS RELEASE OF FONT
Posted: Tue Jan 20, 2015 03:03 PM
Manuel, tambien habria que valorar esto que he visto en algun control

Code (fw): Select all Collapse
   ::SetFont( oFont )
   if ::oFont == nil
      ::oFont := TFont():New()
      ::oFont:hFont := GetStockObject( DEFAULT_GUI_FONT )
   endif
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
Re: EXCESS RELEASE OF FONT
Posted: Mon Jan 26, 2015 08:41 PM
En el foro en inglés he añadido este error que me ha generado un report con la version de FW 15.1:

Code (fw): Select all Collapse
Select all  Expand view
    26/01/15 20:29:30: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
         <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21041) <-FCONT_PRN(13823)
        ------------------------------------------------------------   
    26/01/15 20:29:30: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
         <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21041) <-FCONT_PRN(13823) <-(b)FCONT_EDIT(13644) <-TBUTTON:CLICK(175)
        ------------------------------------------------------------   
    26/01/15 20:29:30: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
         <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21041) <-FCONT_PRN(13823) <-(b)FCONT_EDIT(13644) <-TBUTTON:CLICK(175)
        ------------------------------------------------------------   
    26/01/15 20:47:58: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
         <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21044) <-FCONT_PRN(13823)
        ------------------------------------------------------------   
    26/01/15 20:47:58: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
         <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21044) <-FCONT_PRN(13823) <-(b)FCONT_EDIT(13644) <-TBUTTON:CLICK(175)
        ------------------------------------------------------------   
    26/01/15 20:47:58: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
         <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21044) <-FCONT_PRN(13823) <-(b)FCONT_EDIT(13644) <-TBUTTON:CLICK(175)
        ------------------------------------------------------------


En la línea 1412 de c:\fwh\source\classes\report.prg viene:
Code (fw): Select all Collapse
ASend( ::aFont, "End" )


¿Qué se debe de hacer con esa línea?.
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: EXCESS RELEASE OF FONT
Posted: Tue Jan 27, 2015 06:15 AM

Paz,

Esa línea es correcta.

Lo que cuenta es que todas las asignaciones de fonts que tengas en tu aplicacion usen oObjeto:SetFont( oFont )

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
Re: EXCESS RELEASE OF FONT
Posted: Tue Feb 03, 2015 11:52 AM
Sigue saltanto el error. Son llamadas que hace TREPORT:

Code (fw): Select all Collapse
03/02/15 10:16:02: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
     <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21060) <-ALBA_PRN(10677)
    ------------------------------------------------------------    
03/02/15 10:16:02: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-TPRINTER:END(435) <-TREPORT:END(1405) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175) <-TBUTTON:HANDLEEVENT(1687) <-_FWH(3450)
    ------------------------------------------------------------    
03/02/15 10:16:02: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : -1 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------    
03/02/15 10:16:02: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------    
03/02/15 10:17:17: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
     <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21060) <-ALBA_PRN(10677)
    ------------------------------------------------------------    
03/02/15 10:17:17: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------    
03/02/15 10:17:17: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21060) <-ALBA_PRN(10677) <-(b)ALBA_EDIT(10380) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
Re: EXCESS RELEASE OF FONT
Posted: Wed Feb 04, 2015 08:59 AM
Este es el código con el que da esos mensajes de error. No encuentro donde puede estar el fallo:

function informe(cCaption,cTitulo1,cTitulo2,cCabecera1,cCabecera2,;
aContenido,aPicture,aEncabezado,aAnchura,aTotaliza,;
bTextoSubgr,campoSubgr,nLtrSize,lPreview,lPrinterSetup)
local oRpt
local oFontNorm, oFontNegr
local oPen1, oPen2
local i:=0

local cImpresoraSalida:=""

default cTitulo1 TO ''
default cTitulo2 TO ''
default cCaption TO cTitulo1
default cCabecera1 TO ''
default cCabecera2 TO ''
default campoSubgr TO ''
default campoSubgr TO ''
default lPreview TO .T.
default lPrinterSetup TO .T.

// Selecciona la impresora.
if lPrinterSetup
msginfo('SE VA A IMPRIMIR: '+cTitulo1,'IMPRIMIR')
cImpresoraSalida:=SeleccionaPrn()
if len(cImpresoraSalida) == 0
return NIL
endif
else
cImpresoraSalida:=PrnGetName()
endif

// Genera el informe.

if .not. empty(nLtrSize)
DEFINE FONT oFontNorm NAME "ARIAL" SIZE 0,-nLtrSize
DEFINE FONT oFontNegr NAME "ARIAL" SIZE 0,-nLtrSize BOLD
DEFINE PEN oPen1 WIDTH 1
DEFINE PEN oPen2 WIDTH 3
else
DEFINE FONT oFontNorm NAME "ARIAL" SIZE 0,-10
DEFINE FONT oFontNegr NAME "ARIAL" SIZE 0,-10 BOLD
DEFINE PEN oPen1 WIDTH 2
DEFINE PEN oPen2 WIDTH 5
endif

oRpt := RptBegin({{|| cTitulo1},{|| cTitulo2}},;
{{|| cCabecera1},{|| cCabecera2}},;
{{|| "Pg."+str(oRpt:nPage,3)}},;
{oFontNorm, oFontNegr}, {oPen1, oPen2},,cImpresoraSalida,,;
, lPreview,,, cCaption,;
'CENTER' , 'LEFT', 'RIGHT' )

for i=1 TO len( aContenido )
oRpt:AddColumn(TRcolumn():new({aEncabezado[i]},,;
{aContenido[i] },,;
{HacePicture(aPicture[i],aAnchura[i])},,;
iif(aTotaliza[i]='N',.f.,.t.);
,,,,,,oRpt))
next i
if len(campoSubgr)>0
GROUP ON &(campoSubgr) ;
HEADER eval(bTextoSubgr); //HEADER CTextoSubgr+': '+oRpt:aGroups[1]:cValue;
FONT 2 // EJECT Si se quiere que salte de página en cada group.
endif

END REPORT
sysrefresh()

ACTIVATE REPORT oRpt
GO TOP
//oFontNorm:end()
//oFontNegr:end()
oPen1:end()
oPen2:end()
oRpt:end()
sysrefresh()
return NIL
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
Re: EXCESS RELEASE OF FONT
Posted: Wed Feb 04, 2015 09:00 AM
Pongo el código que genera donde se genera el error en un formato más legible:

Code (fw): Select all Collapse
function informe(cCaption,cTitulo1,cTitulo2,cCabecera1,cCabecera2,;
                 aContenido,aPicture,aEncabezado,aAnchura,aTotaliza,;
                 bTextoSubgr,campoSubgr,nLtrSize,lPreview,lPrinterSetup)
 local oRpt
 local oFontNorm, oFontNegr
 local oPen1, oPen2
 local i:=0
 
 local cImpresoraSalida:=""
 
 default cTitulo1   TO ''
 default cTitulo2   TO ''
 default cCaption   TO cTitulo1
 default cCabecera1 TO ''
 default cCabecera2 TO ''
 default campoSubgr TO ''
 default campoSubgr TO ''
 default lPreview   TO .T.
 default lPrinterSetup TO .T.
   
 // Selecciona la impresora.
 if lPrinterSetup
   msginfo('SE VA A IMPRIMIR: '+cTitulo1,'IMPRIMIR')
   cImpresoraSalida:=SeleccionaPrn()
   if len(cImpresoraSalida) == 0
     return NIL
   endif
  else
    cImpresoraSalida:=PrnGetName()
 endif
 
 // Genera el informe.
 
 if .not. empty(nLtrSize)
    DEFINE FONT oFontNorm NAME "ARIAL" SIZE 0,-nLtrSize
    DEFINE FONT oFontNegr NAME "ARIAL" SIZE 0,-nLtrSize BOLD
    DEFINE PEN oPen1 WIDTH 1
    DEFINE PEN oPen2 WIDTH 3
   else
    DEFINE FONT oFontNorm NAME "ARIAL" SIZE 0,-10
    DEFINE FONT oFontNegr NAME "ARIAL" SIZE 0,-10 BOLD
    DEFINE PEN oPen1 WIDTH 2
    DEFINE PEN oPen2 WIDTH 5
 endif
 
 oRpt :=  RptBegin({{|| cTitulo1},{|| cTitulo2}},;
                   {{|| cCabecera1},{|| cCabecera2}},;
                   {{|| "Pg."+str(oRpt:nPage,3)}},;
                   {oFontNorm, oFontNegr}, {oPen1, oPen2},,cImpresoraSalida,,;
                   , lPreview,,, cCaption,;
                   'CENTER' , 'LEFT', 'RIGHT' )
   
    for i=1 TO len( aContenido )
      oRpt:AddColumn(TRcolumn():new({aEncabezado[i]},,;
                                    {aContenido[i] },,;
                                    {HacePicture(aPicture[i],aAnchura[i])},,;
                                    iif(aTotaliza[i]='N',.f.,.t.);
                                    ,,,,,,oRpt))
    next i
    if len(campoSubgr)>0
      GROUP ON &(campoSubgr) ;
            HEADER eval(bTextoSubgr); //HEADER CTextoSubgr+': '+oRpt:aGroups[1]:cValue;
            FONT 2  // EJECT  Si se quiere que salte de página en cada group.
    endif        

 END REPORT
 sysrefresh()
 
 ACTIVATE REPORT oRpt
 GO TOP
 //oFontNorm:end()
 //oFontNegr:end()
 oPen1:end()
 oPen2:end()
 oRpt:end()
 sysrefresh()
return NIL
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: EXCESS RELEASE OF FONT
Posted: Wed Feb 04, 2015 09:49 AM

Hola,

Después del ACTIVATE REPORT, tienes que finalizar las fonts locales de esa función:

oFontNorm:end()
oFontNegr:end()

¿Por qué lo has comentado?. Prueba y verás como funciona OK.

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: EXCESS RELEASE OF FONT
Posted: Wed Feb 04, 2015 11:46 AM

Mr Verhoven

We shall test the second program you posted and get back to you.

Hope you are using FWH without any changes or additions.

I am asking this because if you include "fivewin.ch", the following lines give syntax error:
default cTitulo1 TO ''
default cTitulo2 TO ''
default cCaption TO cTitulo1
default cCabecera1 TO ''
default cCabecera2 TO ''
default campoSubgr TO ''
default campoSubgr TO ''
default lPreview TO .T.
default lPrinterSetup TO .T.

You can not compile the above program with FWH

Regards



G. N. Rao.

Hyderabad, India
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
Re: EXCESS RELEASE OF FONT
Posted: Wed Feb 04, 2015 12:47 PM
The program compiles OK with fivewin.ch and with all these default ...
We use FWH without any addition or change.
At the begining of prg we use:

Code (fw): Select all Collapse
#include 'inkey.ch'
#include 'set.ch'
#include 'report.ch'
#include 'fivewin.ch'
#include 'rddsys.ch'       
#include "common.ch"
#include "DLL.ch"
#include 'ord.ch'                                    //Para CDX
#include 'Image.ch'
#include "fileio.ch"
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: EXCESS RELEASE OF FONT
Posted: Wed Feb 04, 2015 01:15 PM
Hello,

Have you tried to put this lines?

Code (fw): Select all Collapse
oFontNorm:end()
oFontNegr:end()
Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
Re: EXCESS RELEASE OF FONT
Posted: Wed Feb 04, 2015 04:20 PM
El problema persiste:

Code (fw): Select all Collapse
04/02/15 17:19:12: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 1 )
     <-TFONT:END(246) <-TPRINTER:SETFONT(879) <-(b)TPRINTER(247) <-TPRINTER:GETTEXTWIDTH(0) <-TRLINE:SAY(95) <-TREPORT:ENDPAGE(1477) <-TREPORT:END(1402) <-INFORME(21065) <-FCONT_PRN(13826)
    ------------------------------------------------------------    
04/02/15 17:19:12: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21065) <-FCONT_PRN(13826) <-(b)FCONT_EDIT(13647) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------    
04/02/15 17:19:12: EXCESS RELEASE OF FONT ARIAL[ hFont : 0] ( nCount : 0 )
     <-TFONT:END(246) <-__OBJSENDMSG(0) <-OSEND(288) <-ASEND(256) <-TREPORT:END(1412) <-INFORME(21065) <-FCONT_PRN(13826) <-(b)FCONT_EDIT(13647) <-TBUTTON:CLICK(175)
    ------------------------------------------------------------
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: EXCESS RELEASE OF FONT
Posted: Wed Feb 04, 2015 05:56 PM
Mr Verhoven

Please see part of the code:
Code (fw): Select all Collapse
 oPen1:end()
 oPen2:end()
 oRpt:end()  // DELETE THIS LINE


Please delete line oRpt:End().
oRpt:End() was already called by ACTIVATE command inside Activate() method.
Your code oRpt:End() is a second call releasing the font second time extra.

And restore these lines by uncommenting:
Code (fw): Select all Collapse
 oFontNorm:end()  // required
 oFontNegr:end()  // required
Regards



G. N. Rao.

Hyderabad, India
Posts: 563
Joined: Sun Oct 09, 2005 07:23 PM
Re: EXCESS RELEASE OF FONT
Posted: Wed Feb 04, 2015 07:57 PM

Solved Mr. Nageswaragunupudi, thanks a lot. :D

Continue the discussion