From 526ecc097bb2bfd5274dcfc319fec637151d05d8 Mon Sep 17 00:00:00 2001
From: joostverburg
Date: Mon, 21 Apr 2003 12:41:50 +0000
Subject: [PATCH] language specific fonts
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@2474 212acab6-be3b-0410-9dea-997c60f758d6
---
Contrib/Modern UI/Changelog.txt | 3 +-
Contrib/Modern UI/Readme.html | 23 ++++---
Contrib/Modern UI/System.nsh | 104 +++++++++++++++++++++-----------
3 files changed, 82 insertions(+), 48 deletions(-)
diff --git a/Contrib/Modern UI/Changelog.txt b/Contrib/Modern UI/Changelog.txt
index d2597f15..f992bd7c 100644
--- a/Contrib/Modern UI/Changelog.txt
+++ b/Contrib/Modern UI/Changelog.txt
@@ -1,6 +1,6 @@
NSIS Modern User Interface - VERSION HISTORY
-1.64 - April 7, 2003
+1.64 - April 21, 2003
* Support for license page with checkbox or radiobuttons to let the
user accept the agreement or not
* Macro's for finish headers don't have to be inserted anymore
@@ -8,6 +8,7 @@ NSIS Modern User Interface - VERSION HISTORY
no problems anymore when the users selects the wrong language
* Header text for aborted installation
* New macro's: get language for uninstaller, delete shortcuts
+* Language specific fonts
* Language files have to be updated
1.63 - March 9, 2003
diff --git a/Contrib/Modern UI/Readme.html b/Contrib/Modern UI/Readme.html
index 005ad22b..8f774a39 100644
--- a/Contrib/Modern UI/Readme.html
+++ b/Contrib/Modern UI/Readme.html
@@ -281,17 +281,6 @@ follow these steps:
MUI_CHECKBITMAP bitmap_file
The bitmap with images for the checks of the component select treeview.
Default: ${NSISDIR}\Contrib\Icons\modern.bmp
- MUI_FONT font_name
- MUI_FONTSIZE font_size
- The font for the normal texts.
Defaults: MS Shell Dlg, 8
- MUI_FONT_HEADER font_name
- MUI_FONTSIZE_HEADER font_size
- MUI_FONTSTYLE_HEADER weight [/ITALIC] [/UNDERLINE] [/STRIKE]
- The font for the title in the header.
Defaults: MS Shell Dlg, 8, 700
- MUI_FONT_TITLE font_name
- MUI_FONTSIZE_TITLE font_size
- MUI_FONTSTYLE_TITLE weight [/ITALIC] [/UNDERLINE] [/STRIKE]
- The font for the title on the Welcome and Finish page.
Defaults: Verdana, 12, 700
MUI_INSTALLCOLORS (/windows | (foreground color: RRBBGG)
(background color: RRGGBB))
The colors of the details screen. Use /windows instead of the colors to use the Windows
@@ -337,6 +326,15 @@ follow these steps:
Have a look at the language files for a complete list of all the
string names.
+ You can also customize the fonts for a language using these defines:
+ MUI_FONT_HEADER font_name
+ MUI_FONTSIZE_HEADER font_size
+ MUI_FONTSTYLE_HEADER weight [/ITALIC] [/UNDERLINE] [/STRIKE]
+ The font for the title in the header.
+ MUI_FONT_TITLE font_name
+ MUI_FONTSIZE_TITLE font_size
+ MUI_FONTSTYLE_TITLE weight [/ITALIC] [/UNDERLINE] [/STRIKE]
+ The font for the title on the Welcome and Finish page.
Language selection dialog
If you want the installer to display a language selection dialog
(have a look at the
@@ -599,7 +597,7 @@ MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE
-- 1.64 - April 7, 2003
+
- 1.64 - April 21, 2003
- Support for license page with checkbox or radiobuttons to
let the user accept the agreement or not
@@ -608,6 +606,7 @@ MUI_UNCUSTOMFUNCTION_INSTFILES_LEAVE
no problems anymore when the users selects the wrong language
- Header text for aborted installation
- New macro's: get language for uninstaller, delete shortcuts
+ - Language specific fonts
- Language files have to be updated
diff --git a/Contrib/Modern UI/System.nsh b/Contrib/Modern UI/System.nsh
index f969c5bb..a782d5ad 100644
--- a/Contrib/Modern UI/System.nsh
+++ b/Contrib/Modern UI/System.nsh
@@ -62,38 +62,10 @@
!define MUI_CHECKBITMAP "${NSISDIR}\Contrib\Icons\modern.bmp"
!endif
- !ifndef MUI_FONT
- !define MUI_FONT "MS Shell Dlg"
+ !ifdef MUI_FONT
+ !error "Use SetFont to change the dialog font"
!endif
- !ifndef MUI_FONTSIZE
- !define MUI_FONTSIZE "8"
- !endif
-
- !ifndef MUI_FONT_HEADER
- !define MUI_FONT_HEADER "MS Shell Dlg"
- !endif
-
- !ifndef MUI_FONTSIZE_HEADER
- !define MUI_FONTSIZE_HEADER "8"
- !endif
-
- !ifndef MUI_FONTSTYLE_HEADER
- !define MUI_FONTSTYLE_HEADER "700"
- !endif
-
- !ifndef MUI_FONT_TITLE
- !define MUI_FONT_TITLE "Verdana"
- !endif
-
- !ifndef MUI_FONTSIZE_TITLE
- !define MUI_FONTSIZE_TITLE "12"
- !endif
-
- !ifndef MUI_FONTSTYLE_TITLE
- !define MUI_FONTSTYLE_TITLE "700"
- !endif
-
!ifndef MUI_INSTALLCOLORS
!define MUI_INSTALLCOLORS "/windows"
!endif
@@ -165,7 +137,6 @@
!endif
CheckBitmap "${MUI_CHECKBITMAP}"
- SetFont "${MUI_FONT}" "${MUI_FONTSIZE}"
InstallColors ${MUI_INSTALLCOLORS}
InstProgressFlags ${MUI_PROGRESSBAR}
@@ -341,7 +312,7 @@
!insertmacro MUI_HEADERBITMAP_INIT
- !insertmacro MUI_GUIINIT_BASIC
+ !insertmacro MUI_UNGUIINIT_BASIC
!macroend
@@ -351,7 +322,38 @@
Push ${MUI_TEMP2}
GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1037
- CreateFont ${MUI_TEMP2} "${MUI_FONT_HEADER}" "${MUI_FONTSIZE_HEADER}" "${MUI_FONTSTYLE_HEADER}"
+ CreateFont ${MUI_TEMP2} "$(MUI_FONT_HEADER)" "$(MUI_FONTSIZE_HEADER)" "$(MUI_FONTSTYLE_HEADER)"
+ SendMessage ${MUI_TEMP1} ${WM_SETFONT} ${MUI_TEMP2} 0
+ SetBkColor ${MUI_TEMP1} "${MUI_BGCOLOR}"
+
+ GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1038
+ SetBkColor ${MUI_TEMP1} "${MUI_BGCOLOR}"
+
+ GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1034
+ SetBkColor ${MUI_TEMP1} "${MUI_BGCOLOR}"
+
+ GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1039
+ SetBkColor ${MUI_TEMP1} "${MUI_BGCOLOR}"
+
+ GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1028
+ SetBkColor ${MUI_TEMP1} -1
+ GetWindowText ${MUI_TEMP2} ${MUI_TEMP1}
+ GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1256
+ SetBkColor ${MUI_TEMP1} -1
+ SendMessage ${MUI_TEMP1} ${WM_SETTEXT} ${NSIS_MAX_STRLEN} "STR:${MUI_TEMP2}"
+
+ Pop ${MUI_TEMP2}
+ Pop ${MUI_TEMP1}
+
+!macroend
+
+!macro MUI_UNGUIINIT_BASIC
+
+ Push ${MUI_TEMP1}
+ Push ${MUI_TEMP2}
+
+ GetDlgItem ${MUI_TEMP1} $HWNDPARENT 1037
+ CreateFont ${MUI_TEMP2} "$(un.MUI_FONT_HEADER)" "$(un.MUI_FONTSIZE_HEADER)" "$(un.MUI_FONTSTYLE_HEADER)"
SendMessage ${MUI_TEMP1} ${WM_SETFONT} ${MUI_TEMP2} 0
SetBkColor ${MUI_TEMP1} "${MUI_BGCOLOR}"
@@ -1001,7 +1003,7 @@
GetDlgItem ${MUI_TEMP2} ${MUI_TEMP1} 1201
SetBkColor ${MUI_TEMP2} "${MUI_BGCOLOR}"
- CreateFont ${MUI_TEMP3} "${MUI_FONT_TITLE}" "${MUI_FONTSIZE_TITLE}" "${MUI_FONTSTYLE_TITLE}"
+ CreateFont ${MUI_TEMP3} "$(MUI_FONT_TITLE)" "$(MUI_FONTSIZE_TITLE)" "$(MUI_FONTSTYLE_TITLE)"
SendMessage ${MUI_TEMP2} ${WM_SETFONT} ${MUI_TEMP3} 0
GetDlgItem ${MUI_TEMP2} ${MUI_TEMP1} 1202
@@ -1353,7 +1355,7 @@
GetDlgItem ${MUI_TEMP2} ${MUI_TEMP1} 1201
SetBkColor ${MUI_TEMP2} "${MUI_BGCOLOR}"
- CreateFont ${MUI_TEMP3} "${MUI_FONT_TITLE}" "${MUI_FONTSIZE_TITLE}" "${MUI_FONTSTYLE_TITLE}"
+ CreateFont ${MUI_TEMP3} "$(MUI_FONT_TITLE)" "$(MUI_FONTSIZE_TITLE)" "$(MUI_FONTSTYLE_TITLE)"
SendMessage ${MUI_TEMP2} ${WM_SETFONT} ${MUI_TEMP3} 0
GetDlgItem ${MUI_TEMP2} ${MUI_TEMP1} 1202
@@ -1919,6 +1921,30 @@
!macroend
+!macro MUI_LANGUAGEFILE_LANGSTRING_INSTFONT NAME DEFAULT
+
+ !ifdef "${NAME}"
+ Langstring "${NAME}" 0 "${${NAME}}"
+ !undef "${NAME}"
+ !else
+ Langstring "${NAME}" 0 "${DEFAULT}"
+ !endif
+
+!macroend
+
+!macro MUI_LANGUAGEFILE_LANGSTRING_FONT NAME DEFAULT
+
+ !ifdef "${NAME}"
+ Langstring "${NAME}" 0 "${${NAME}}"
+ Langstring "un.${NAME}" 0 "${${NAME}}"
+ !undef "${NAME}"
+ !else
+ Langstring "${NAME}" 0 "${DEFAULT}"
+ Langstring "un.${NAME}" 0 "${DEFAULT}"
+ !endif
+
+!macroend
+
!macro MUI_LANGUAGEFILE_END
!insertmacro MUI_LANGUAGEFILE_DEFINE "MUI_${LANGUAGE}_LANGNAME" "MUI_LANGNAME"
@@ -1934,6 +1960,14 @@
!define MUI_LANGDLL_PUSHLIST "'${MUI_${LANGUAGE}_LANGNAME}' ${LANG_${LANGUAGE}} ${MUI_LANGDLL_PUSHLIST_TEMP}"
!endif
+ !insertmacro MUI_LANGUAGEFILE_LANGSTRING_FONT "MUI_FONT_HEADER" "MS Shell Dlg"
+ !insertmacro MUI_LANGUAGEFILE_LANGSTRING_FONT "MUI_FONTSIZE_HEADER" "8"
+ !insertmacro MUI_LANGUAGEFILE_LANGSTRING_FONT "MUI_FONTSTYLE_HEADER" "700"
+
+ !insertmacro MUI_LANGUAGEFILE_LANGSTRING_INSTFONT "MUI_FONT_TITLE" "Verdana"
+ !insertmacro MUI_LANGUAGEFILE_LANGSTRING_INSTFONT "MUI_FONTSIZE_TITLE" "12"
+ !insertmacro MUI_LANGUAGEFILE_LANGSTRING_INSTFONT "MUI_FONTSTYLE_TITLE" "700"
+
!insertmacro MUI_LANGUAGEFILE_NSISCOMMAND "Name" "MUI_NAME"
SubCaption 0 " "