#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:oFont: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 )
//----------------------------------------------------------------------------//