[英]How can I change the font of the captions in NSIS?
我正在嘗試更改 NSIS 中字幕的字體,並且我正在尋找更改 NSIS 中字幕字體的腳本行。
SetFont
設置 UI 使用的基本字體。 MUI 創建了一些自定義的 fonts 但它們基於SetFont
設置的 ^Font 和 ^FontSize lang-strings。 Colors 與字體分開,並使用幾個 MUI 定義和SetCtlColors
進行設置。
如果你想在不同的地方自定義 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.