Dear Mr. Rao,
thank you for helping me.
If I read the Font from the restored value the result differ from the original Font. I did many tests this afternoon also with the build in method cGenPrg with the same result.
Please see the screen shot.
The height is not like the original.
Best regards,
Otto
This is my test program
#include "FiveWin.ch"
Function Main()
LOCAL oWnd, oSay, cVar
//LOCAL oFont := TFont():New( 'Calibri', 15.40, 35, .f., .f., 0, 0, 400, .f., .f., .f., 0,3, 2, 1,, 34 )
LOCAL oFont
local cText := memoread("RAOfont.txt")
oFont := FontFromText( cText )
msginfo( "RAOfont.txt" )
//oFont := TFont():New( {"Calibri",0,24,.F.,.F.,0,0,,.F.,.F.,.F.,0,3,2,1,,34} )
DEFINE WINDOW oWnd;
FROM 1,5 TO 20,65;
TITLE "Test font. oSay:lBold is always .t.!"
@ 12,10 ;
SAY oSay ;
PROMPT "ABC Is this bold now?" ;
OF oWnd ;
FONT oFont ;
SIZE 200, 100
@ 2,10 BUTTON "SelFont";
SIZE 100,50;
ACTION oSay:SelFont() OF oWnd
@ 2,40 BUTTON "cGenPrg";
SIZE 100,50;
ACTION ( cVar := oSay:oFont:cGenPrg( cVar ),memowrit("font.txt",cVar) ) OF oWnd
@ 5,40 BUTTON "FontToText";
SIZE 100,50;
ACTION (cVar := FontToText( oFont ),memowrit( "RAOfont.txt",cVar) ) OF oWnd
ACTIVATE WINDOW oWnd
RETU NIL
//----------------------------------------------------------------------------//
function FontToText( oFont )
return FW_ValToExp( { ;
oFont:cFaceName, 0, oFont:nInpHeight, .f., oFont:lBold, oFont:nEscapement, ;
oFont:nOrientation, nil, oFont:lItalic, oFont:lUnderline, oFont:lStrikeOut, ;
oFont:nCharSet, oFont:nOutPrecision, oFont:nClipPrecision, oFont:nQuality, ;
nil, oFont:nPitchFamily } )
//----------------------------------------------------------------------------//
function FontFromText( cText )
return HB_ExecFromArray( TFont(), "NEW", &cText )
//----------------------------------------------------------------------------//