chooseFont

chooseFont

Postby Silvio.Falconi » Tue Nov 03, 2020 12:51 pm

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
Last edited by Silvio.Falconi on Thu Apr 20, 2023 7:39 am, edited 3 times in total.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: chooseFont

Postby karinha » Tue Nov 03, 2020 3:34 pm

Use un .INI para controlar las fuentes.

Code: Select all  Expand view

#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 - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7811
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: chooseFont

Postby Silvio.Falconi » Tue Nov 03, 2020 3:43 pm

No
this give me also the color and other effect

local aFont, nRGBColor := 0
aFont := ChooseFont( , @nRGBColor )
MsgInfo( nRGBColor )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm

Re: chooseFont

Postby Silvio.Falconi » Fri Nov 06, 2020 9:42 am

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 ?
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7053
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Enrico Maria Giordano and 96 guests