Old 3rd September 2006, 08:21   #1
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
Smile runtime equivalent to SetFont?

Hi,

How can I change the font for the whole installer at runtime? Something like using SetFont, but SetFont is compile time only.

Thanks!
Backland is offline   Reply With Quote
Old 3rd September 2006, 11:12   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You should be able to send WM_SETFONT with SendMessage to $HWNDPARENT

-Stu
Afrow UK is offline   Reply With Quote
Old 3rd September 2006, 12:45   #3
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
can that change all the installer controls fonts?
Backland is offline   Reply With Quote
Old 3rd September 2006, 12:59   #4
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
Just tried it, i would need to send the message to each and every control manually...

NSIS is obviously remember what is set with SetFont at compile time and applying it whenever it creates controls, so there should be a way to change it at runtime.
Backland is offline   Reply With Quote
Old 8th September 2006, 15:14   #5
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
It doesn't change the font on its own with SetFont. It changes the dialog resource. When the dialog creation function is called, it reads that resource and applies the correct font. There's no API to apply a different font, probably because the font affects the size of the new window. You'll have to manually set it to every control.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 8th September 2006, 15:34   #6
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
There is no way to specify a font before the GUI is loaded?

So if we want to change the font, we could change that variable and restart the installer

Im not sur ehow we could feed the variable to the installer, maybe commandline, or a resource in the installer, etc
Backland is offline   Reply With Quote
Old 8th September 2006, 16:24   #7
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
If you really want, you could pack the installer in another installer that'd modify the resource to change the font before it starts the packed installer. You might be able to use Resource Hacker to change the font from the command line.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 8th September 2006, 17:17   #8
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
Good idea, I will look into it...

Changing the whole installer font would be great, because if you ever run an NSIS installer on a large resolution, its impossible to read it and NSIS does not adjust to the windows font size settings.

Anhy other ideas would be great
Backland is offline   Reply With Quote
Old 8th September 2006, 17:22   #9
Backland
Senior Member
 
Join Date: Sep 2006
Posts: 150
I have attached an example of how the InstallShield wizard adjusts everything to the Windows system font settings, this is on a fairly high resolution.
Attached Images
File Type: jpg size.jpg (92.7 KB, 472 views)
Backland is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump