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
chooseFont
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
chooseFont
Last edited by Silvio.Falconi on Fri Nov 06, 2020 9:35 am, edited 2 times in total.
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
Re: chooseFont
Use un .INI para controlar las fuentes.
Code: Select all
#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 )
João Santos - São Paulo - Brasil
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: chooseFont
No
this give me also the color and other effect
local aFont, nRGBColor := 0
aFont := ChooseFont( , @nRGBColor )
MsgInfo( nRGBColor )
this give me also the color and other effect
local aFont, nRGBColor := 0
aFont := ChooseFont( , @nRGBColor )
MsgInfo( nRGBColor )
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC
- Silvio.Falconi
- Posts: 4956
- Joined: Thu Oct 18, 2012 7:17 pm
Re: chooseFont
If I call ChooseFont( ,@nColoreFont )
it show me this
So I saw and can select also the effect Strikeoutline and UNDERLINE
If make If I call ChooseFont() I cannot see the colors,and the effect
for the color I can resolve I have a my function or I can use choosecolor()
but for the effect I not Know how resolve
I think choosefont can have another paramter to show only effect, where I can found an help for this ?
I saw on source code choosefont can have these parameters
// aPreviousFont, @nRGBColor, hPrinterDC, nFlags --> aNewFont
I not found the possibility to show effect( StrikeOut and Underline )
some one can help me pls ?
So I understood I can show the effect and also the colors
but how I can disable only the colors ?
it show me this
So I saw and can select also the effect Strikeoutline and UNDERLINE
If make If I call ChooseFont() I cannot see the colors,and the effect
for the color I can resolve I have a my function or I can use choosecolor()
but for the effect I not Know how resolve
I think choosefont can have another paramter to show only effect, where I can found an help for this ?
I saw on source code choosefont can have these parameters
// aPreviousFont, @nRGBColor, hPrinterDC, nFlags --> aNewFont
I not found the possibility to show effect( StrikeOut and Underline )
some one can help me pls ?
So I understood I can show the effect and also the colors
but how I can disable only the colors ?
I use : FiveWin for Harbour August 2020 (Revision) - Harbour 3.2.0dev (r1712141320) - Bcc7.30 - xMate ver. 1.15.3 - PellesC