Archive: Using bold text on MUI custom page


Using bold text on MUI custom page
I am using MUI 1.65 and want to make some text on my custom pages appear in BOLD. The font example in the manual uses the "Tahoma" font but all I want to do is change the weight of whatever font is being used to display the custom page.

Am I right in thinking that MUI's default font is specified as "MS Shell Dlg" so all I have to do is something like this:


!insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ioCustom.ini"
Pop $R0 ; HWND of dialog
GetDlgItem $R1 $R0 1205 ; Field 6 = the warning message
CreateFont $R2 "MS Shell Dlg" 10 700
SendMessage $R1 ${WM_SETFONT} $R2 0
!insertmacro MUI_INSTALLOPTIONS_SHOW

or is there a better way to achieve the same thing?

Not that I am awear of.

-Stu


Yep, this is the right way.


Thanks for confirming I was on the right track (this was my first attempt at doing anything with fonts).

Brian


I am brand new at NSIS scripting, but I'm learning a lot fast.

I have searched the forum and the sample code for the past 2 days for bold code and this is the best example that I have found. However, I don't understand how this code works. I have a label on a custom page that I want to make bold, but I don't get it. Can anyone provide any insight into:

1.) Where you put this code
2.) How it works

My current code is like this. Up where my pages are defined I have this to display a custom page:

Page custom CustomFunction CustomLeave


I have a bitmap to display, so I have this:
Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\logo1.bmp "logo1.bmp"
File /oname=$PLUGINSDIR\logo2.bmp "logo2.bmp"
!insertmacro INSTALLOPTIONS_EXTRACT "custom.ini"
FunctionEnd


Then in my custom function I have this:
Function CustomFunction
WriteIniStr $PLUGINSDIR\custom.ini "Field 2" Text $PLUGINSDIR\logo1.bmp
WriteIniStr $PLUGINSDIR\custom.ini "Field 11" Text $PLUGINSDIR\logo2.bmp
!insertmacro MUI_HEADER_TEXT "Custom Page" ""

!insertmacro INSTALLOPTIONS_DISPLAY "custom.ini"
FunctionEnd


This all works fine; I can see both of my bitmaps on my custom page. My label is "Field 4", and I want to make it bold. Any suggestions are appreciated.

- scubanarc

My label is "Field 4", and I want to make it bold.
The InstallOptions ReadMe explains how to change the font. Instead of using the INSTALLOPTIONS_DISPLAY macro you need to use the INSTALLOPTIONS_INITDIALOG and INSTALLOPTIONS_SHOW macros.

Look for the "Fonts and Colors" section near the end of the InstallOptions ReadMe which can be found in the Docs\InstallOptions folder of your NSIS installation or online at http://nsis.sourceforge.net/Docs/Ins...ns/Readme.html