If I inst the ttf file to fonts directory, I just need to copy the ttf file to there and using:
SetOutPath $FONTS
File MSYH.TTF
System::Call "GDI32::AddFontResource(t) i ('MSYH.TTF') .s" It is a easy way and the value in registry is correct. But if I want to inst it to my directory, I must use:SetOutPath $INSTDIR\TrueType
File MSYH.TTF
WriteRegStr HKLM "Software\Microsoft\Windows NT\CurrentVersion\Fonts" "微软雅黑 (TrueType)" "$INSTDIR\TrueType\MSYH.TTF"
System::Call "GDI32::AddFontResource(t) i ('$INSTDIR\TrueType\MSYH.TTF') .s" When there are a large number of fonts to install to custom directory, I must write each font name to registry but not using the FontName plugin, as the reason above. After searching by google, I founder that a function GetTextFaceA. But I don't know how to use it to get the name of a font. Please help me.