简体   繁体   English

使用NSIS安装字体

[英]Installing Fonts using NSIS

I am installing fonts in my setup application using: 我正在使用以下方法在安装应用程序中安装字体:

Section "Fonts"
  SetOutPath "$FONTS"
  StrCpy $FONT_DIR $FONTS
    !insertmacro InstallTTFfont '..\FONTS\English\Arial.ttf'
    SendMessage ${HWND_BROADCAST} ${WM_FONTCHANGE} 0 0 /TIMEOUT=5000
SectionEnd

(I have included !include FontReg.nsh and !include FontName.nsh) At times, especially on Win 7(with UAC enabled), the setup progress goes into a non-reponsive mode(progress bar remains frozen at the end of the font installation and setup does not proceed). (我包括了!include FontReg.nsh和!include FontName.nsh)有时,尤其是在Win 7(启用UAC)上,设置进度会进入非响应模式(进度栏在字体末尾保持冻结状态)安装和设置无法继续进行)。 Is there anything to avoid this scenario?. 有什么可以避免这种情况的吗? Kindly help. 请帮助。

Thanks, Bomzinho 谢谢,Bomzinho

There is some macros dedicated for registering fonts available on the NSIS wiki. NSIS Wiki上有一些专用于注册字体的宏。 They do a bit more than just copying the .ttf file. 它们所做的不仅仅是复制.ttf文件。

Also you could look at the page on http://nsis.sourceforge.net/Advanced_Font_Installation 您也可以查看http://nsis.sourceforge.net/Advanced_Font_Installation上的页面

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM