No se si entendi bien lo que quieres hacer, pero yo para los fonts usados en el browse hago asi: (espero te sirva como idea)
Code: Select all
#define FW_NORMAL 400
#define FW_BOLD 700
********
FUNCTION SelezionaFontBrowses()
********
LOCAL aFont, aPreviousFont, nRGB, oNewFont, oFont
LOCAL cFaceName := "", nHeight, nWidth, nEscapement, nOrientation, nWeight, lItalic, lUnderLine, lStrikeOut, nCharSet, nOutPrecision, nClipPrecision, nQuality, nPitchAndFamily
oFont := FontBrowses()
aFont := ChooseFont( { oFont:nInpHeight, oFont:nInpWidth, oFont:nEscapement,;
oFont:nOrientation, oFont:nWeight, oFont:lItalic,;
oFont:lUnderLine, oFont:lStrikeOut, oFont:nCharSet,;
oFont:nOutPrecision, oFont:nClipPrecision,;
oFont:nQuality, oFont:nPitchFamily, oFont:cFaceName },;
@nRGB )
IF !Empty( aFont[ LF_FACENAME ] )
oFont:end()
oV:oFontBrowses := TFont():New( aFont[ LF_FACENAME ],, aFont[ LF_HEIGHT ], .f.,;
! ( aFont[ LF_WEIGHT ] == FW_NORMAL ),;
aFont[ LF_ESCAPEMENT ], aFont[ LF_ORIENTATION ],;
aFont[ LF_WEIGHT ], aFont[ LF_ITALIC ],;
aFont[ LF_UNDERLINE ], aFont[ LF_STRIKEOUT ],;
aFont[ LF_CHARSET ], aFont[ LF_OUTPRECISION ],;
aFont[ LF_CLIPPRECISION ], aFont[ LF_QUALITY ],,;
aFont[ LF_PITCHANDFAMILY ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_Height", aFont[ LF_HEIGHT ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_Width", aFont[ 2 ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_nScapement", aFont[ LF_ESCAPEMENT ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_nOrientation", aFont[ LF_ORIENTATION ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_Weight", aFont[ LF_WEIGHT ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_ITALIC", aFont[ LF_ITALIC ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_UNDERLINE", aFont[ LF_UNDERLINE ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_STRIKEOUT", aFont[ LF_STRIKEOUT ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_nCharSet", aFont[ LF_CHARSET ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_OUTPRECISION", aFont[ LF_OUTPRECISION ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_CLIPPRECISION", aFont[ LF_CLIPPRECISION ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_QUALITY", aFont[ LF_QUALITY ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_PITCHANDFAMILY", aFont[ LF_PITCHANDFAMILY ] )
SetProfile( oV:cIniStaz, "InfoBrowses", "Font_FACENAME", aFont[ LF_FACENAME ] )
ENDIF
RETURN NIL
*
** SelezionaFontBrowses
********
FUNCTION FontBrowses()
********
LOCAL cFaceName := "", nHeight, nWidth, nEscapement, nOrientation, nWeight, lItalic, lUnderLine, lStrikeOut, nCharSet, nOutPrecision, nClipPrecision, nQuality, nPitchAndFamily
LOCAL oFont
cFaceName := ProfileString( oV:cIniStaz, "InfoBrowses", "Font_FACENAME", "" )
IF EMPTY( cFaceName )
oFont := RetMainWnd():oFont
ELSE
nHeight := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_HEIGHT", -19 )
nWidth := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_Width", 0 )
nEscapement := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_nScapement", 0 )
nOrientation := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_nOrientation", 0 )
nWeight := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_Weight", 400 )
lItalic := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_ITALIC", 0 ) = 1
lUnderLine := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_UNDERLINE", 0 ) = 1
lStrikeOut := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_STRIKEOUT", 0 ) = 1
nCharSet := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_nCharSet", 0 )
nOutPrecision := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_OUTPRECISION", 1 )
nClipPrecision := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_CLIPPRECISION", 2 )
nQuality := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_QUALITY", 1 )
nPitchAndFamily := ProfileNum( oV:cIniStaz, "InfoBrowses", "Font_PITCHANDFAMILY", 34 )
oFont := TFont():New( cFaceName,, nHeight, .f.,;
! ( nWeight == FW_NORMAL ),;
nEscapement, nOrientation,;
nWeight, lItalic,;
lUnderLine, lStrikeOut,;
nCharSet, nOutPrecision,;
nClipPrecision, nQuality,,;
nPitchAndFamily )
ENDIF
RETURN oFont
*
** eof FontBrowses