choosefont have the parameter?
I ask it because on my pc I cannot see the colors
and when I wish select a font it must me return all also the color
I cannot see the color and the effect type Underlined or Strikethrough
#include "Fivewin.ch"
#define FW_NORMAL 400
#define FW_BOLD 700
#define LOGPIXELSY 90
function Main()
LOCAL oIni, cFont, aFont, aOldFont, hDC
INI oIni FILE "test.INI"
GET cFont SECTION "Stampanti" ENTRY "FontInStampa" OF oIni DEFAULT "Arial| 0| -12| 0| 0| 0| 0| 0"
ENDINI
aFont := Array( 14 )
aFont[LF_FACENAME] := ALLTRIM(StrToken(cFont,1,"|" ))
aFont[LF_WIDTH] := VAL( StrToken( cFont, 2, "|" ))
aFont[LF_HEIGHT] := Int( -VAL( StrToken( cFont, 3, "|" ) ) * GetDeviceCaps( hDC := GetDC( GetDesktopWindow() ), LOGPIXELSY ) / 72 )
ReleaseDC( GetDesktopWindow(), hDC )
aFont[LF_WEIGHT] := IF( VAL( StrToken( cFont, 4, "|" )) > 0, FW_BOLD, FW_NORMAL )
aFont[LF_ESCAPEMENT] := VAL( StrToken( cFont, 8, "|" ))
aFont[LF_ITALIC] := VAL( StrToken( cFont, 5, "|" )) > 0
aFont[LF_UNDERLINE] := VAL( StrToken( cFont, 6, "|" )) > 0
aOldFont := AClone( aFont )
cFont := aFont[LF_FACENAME] + "|" +;
cValToChar( aFont[LF_WIDTH] ) + "|" +;
cValToChar( aFont[LF_HEIGHT] ) + "|" +;
cValToChar( aFont[LF_WEIGHT] ) + "|" +;
cValToChar( aFont[LF_ESCAPEMENT] ) + "|" +;
cValToChar( aFont[LF_ITALIC] ) + "|" +;
cValToChar( aFont[LF_UNDERLINE] )
// Test in entrata
MsgInfo( cFont )
aFont := ChooseFont( aFont )
cFont := aFont[LF_FACENAME] + "|" +;
cValToChar( aFont[LF_WIDTH] ) + "|" +;
cValToChar( -aFont[LF_HEIGHT] ) + "|" +;
cValToChar( aFont[LF_WEIGHT] ) + "|" +;
cValToChar( aFont[LF_ESCAPEMENT] ) + "|" +;
cValToChar( aFont[LF_ITALIC] ) + "|" +;
cValToChar( aFont[LF_UNDERLINE] )
// Test in uscita
MsgInfo( cFont )
return If( ! Empty( aFont[ LF_FACENAME ] ), aFont, aOldFont )
Return to FiveWin for Harbour/xHarbour
Users browsing this forum: Google [Bot] and 52 guests