[英]How can I change the font of the captions in NSIS?
I am trying to change the font of the captions in NSIS, and I am looking for script lines that change the font of the captions in NSIS.我正在尝试更改 NSIS 中字幕的字体,并且我正在寻找更改 NSIS 中字幕字体的脚本行。
SetFont
sets the base font used by the UI. SetFont
设置 UI 使用的基本字体。 MUI creates some custom fonts but base them on the ^Font and ^FontSize lang-strings set by SetFont
. MUI 创建了一些自定义的 fonts 但它们基于
SetFont
设置的 ^Font 和 ^FontSize lang-strings。 Colors are separate from the font and are set with a couple of MUI defines and SetCtlColors
. Colors 与字体分开,并使用几个 MUI 定义和
SetCtlColors
进行设置。
If you want custom fonts (different from SetFont
) in various places then you must set them yourself manually:如果你想在不同的地方自定义 fonts (不同于
SetFont
),那么你必须自己手动设置它们:
SetFont "Comic Sans MS" 9
!include MUI2.nsh
!define MUI_CUSTOMFUNCTION_GUIINIT MyGuiInit
!define MUI_TEXTCOLOR 00AAAA
!define MUI_BGCOLOR FFAAAA
!insertmacro MUI_PAGE_WELCOME
!define MUI_PAGE_CUSTOMFUNCTION_SHOW onCompsShow
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_STARTMENU SMP $9
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE English
var MyFont
Function MyGuiInit
IntOp $2 $(^FontSize) + 5
CreateFont $1 "Impact" "$2"
SendMessage $mui.Header.Text ${WM_SETFONT} $1 1
CreateFont $MyFont "Terminal" "$(^FontSize)"
SendMessage $mui.Header.SubText ${WM_SETFONT} $MyFont 1
FunctionEnd
Function onCompsShow
SendMessage $mui.ComponentsPage.Text ${WM_SETFONT} $MyFont 1
FunctionEnd
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.