Page 1 of 1

chooseFont

Posted: Tue Nov 03, 2020 12:51 pm
by Silvio.Falconi
choosefont have the parameter?

I ask it because on my pc I cannot see the colors

Image


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

Re: chooseFont

Posted: Tue Nov 03, 2020 3:34 pm
by karinha
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 )
 

Re: chooseFont

Posted: Tue Nov 03, 2020 3:43 pm
by Silvio.Falconi
No
this give me also the color and other effect

local aFont, nRGBColor := 0
aFont := ChooseFont( , @nRGBColor )
MsgInfo( nRGBColor )

Re: chooseFont

Posted: Fri Nov 06, 2020 9:42 am
by Silvio.Falconi
If I call ChooseFont( ,@nColoreFont )

it show me this

Image

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

Image



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 ?