|
|
|
#1
|
||||
|
||||
|
New Font
Hello guys.
How can i use a new font (font.ttf) that i don´t have in my system, on the inno setup? Example of font that i don´t have in my system. http://www.1001freefonts.com/image.p...o%20The%20Hand The script to this case is the same in the post # 138. Thanks in advanced. |
| Sponsored Links |
|
#2
|
||||
|
||||
|
[Files]
Source: Font.ttf; DestDir: {tmp}; Flags: dontcopy; [Code] #ifdef UNICODE #define A "W" #else #define A "A" #endif const FR_PRIVATE = $10; function AddFontResource(lpszFilename:string;fl:dword;pdv:i nteger): Integer; external 'AddFontResourceEx{#A}@gdi32.dll stdcall'; function RemoveFontResource(lpszFilename:string;fl:dword;pd v:integer): BOOL; external 'RemoveFontResourceEx{#A}@gdi32.dll stdcall'; procedure InitializeWizard; begin ExtractTemporaryFile('Font.ttf'); AddFontResource(ExpandConstant('{tmp}\Font.ttf'), FR_PRIVATE, 0); end; procedure DeinitializeSetup; begin RemoveFontResource(ExpandConstant('{tmp}\Font.ttf' ), FR_PRIVATE, 0); end; __________________________________________________ ______________ Glad could help with font. Work on ANSI and UNICODE Sorry for bad english. Last edited by Razor12911; 19-01-2013 at 13:56. |
|
#3
|
||||
|
||||
|
Quote:
I will try use this code and return the result. |
|
#4
|
||||
|
||||
|
[Code]
var Image1, Image2, Image3, Image4: Longint; procedure InitializeWizard(); begin h:=WizardForm.Handle; Image1:=ImgLoad(h,ExpandConstant('{tmp}\1.jpg'),0, 0,600,400,True,True); Image2:=ImgLoad(h,ExpandConstant('{tmp}\2.jpg'),0, 0,600,400,True,True); Image3:=ImgLoad(h,ExpandConstant('{tmp}\3.jpg'),0, 0,600,400,True,True); Image4:=ImgLoad(h,ExpandConstant('{tmp}\4.jpg'),0, 0,600,400,True,True); ImgLoad(h,ExpandConstant('{tmp}\glass.png'),20,130 ,560,220,True,True); ImgSetVisibility(Image1,False); ImgSetVisibility(Image2,False); ImgSetVisibility(Image3,False); ImgSetVisibility(Image4,False); ImgApplyChanges(WizardForm.Handle); end; procedure Components(CurPageID: Integer); begin ImgSetVisibility(Image1,False); ImgSetVisibility(Image2,False); ImgSetVisibility(Image3,False); ImgSetVisibility(Image4,False); case CurPageID of wpWelcome: begin ImgSetVisibility(Image1,True); end; wpReady: begin ImgSetVisibility(Image2,True); end; wpInstalling: begin ImgSetVisibility(Image3,True); end; wpFinish: begin ImgSetVisibility(Image4,True); end; end; end; procedure CurPageChanged(CurPageID: Integer); begin Components(CurPageID); ImgApplyChanges(WizardForm.Handle); end; Last edited by Razor12911; 20-01-2013 at 00:33. |
|
#5
|
||||
|
||||
|
Can you give a example of glass button?
I want to change the button this instaler. http://s9.postimage.org/pg8m175pb/Image_Setup.jpg I wanto to learn these use two types of button: Type 1: http://s2.postimage.org/64jk9wgk9/button.png Type 2: http://advertboy.files.wordpress.com/2007/11/blue.jpg |
|
#6
|
||||
|
||||
|
Quote:
[Files] Source: buttons.png; DestDir: {tmp}; Flags: dontcopy [Code] var hback, hnext, hcancel :Longint ButtonFont: TFont; procedure SetStateNewButtons; begin with WizardForm.BackButton do begin BtnSetText(hBackBtn,PAnsiChar(Caption)); BtnSetVisibility(hBackBtn,Visible); BtnSetEnabled(hBackBtn,Enabled); end; with WizardForm.NextButton do begin BtnSetText(hNextBtn,PAnsiChar(Caption)); BtnSetVisibility(hNextBtn,Visible); BtnSetEnabled(hNextBtn,Enabled); end; with WizardForm.CancelButton do begin BtnSetText(hCancelBtn,PAnsiChar(Caption)); BtnSetVisibility(hCancelBtn,Visible); BtnSetEnabled(hCancelBtn,Enabled); end; end; procedure WizardFormBtnClick(hBtn:HWND); var Btn:TButton; begin case hBtn of hCancelBtn: Btn:=WizardForm.CancelButton; hNextBtn: Btn:=WizardForm.NextButton; hBackBtn: Btn:=WizardForm.BackButton; hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton; hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton; end; Btn.OnClick(Btn); SetStateNewButtons; BtnRefresh(hBtn); end; Procedure ButtonsTexture; begin ButtonFont:=TFont.Create; ButtonFont.Name:='Arial'; ButtonFont.Size:=13; ButtonFont.Color:=$FFFFFF; with WizardForm.BackButton do begin hBackBtn:=BtnCreate(WizardForm.Handle,Left-52,Top-65,Width+25,Height+16,ExpandConstant('{tmp}\button .png'),18,False); BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallba ck(@WizardFormBtnClick,1)); BtnSetFont(hBackBtn,ButtonFont.Handle); BtnSetFontColor(hBackBtn,$DAE369,$DAE369,$DAE369,$ B6B6B6); BtnSetCursor(hBackBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.NextButton do begin hNextBtn:=BtnCreate(WizardForm.Handle,Left-28,Top-65,Width+25,Height+16,ExpandConstant('{tmp}\button .png'),18,False); BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallba ck(@WizardFormBtnClick,1)); BtnSetFont(hNextBtn,WFButtonFont.Handle); BtnSetFontColor(hNextBtn,$DAE369,$DAE369,$DAE369,$ B6B6B6); BtnSetCursor(hNextBtn,GetSysCursorHandle(32649)); Width:=0; Height:=0; end; with WizardForm.CancelButton do begin hCancelBtn:=BtnCreate(WizardForm.Handle,Left-223,Top-65,Width+25,Height+16,ExpandConstant('{tmp}\button .png'),18,False); BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCall back(@WizardFormBtnClick,1)); BtnSetFont(hCancelBtn,ButtonFont.Handle); BtnSetFontColor(hCancelBtn,$DAE369,$DAE369,$DAE369 ,$B6B6B6); BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649)) ; Width:=0; Height:=0; end; with WizardForm.DirBrowseButton do begin hDirBrowseBtn:=BtnCreate(WizardForm.Handle,Left+15 0,Top+55,Width-40,Height+10,ExpandConstant('{tmp}\browse.png'),6, False); BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnC allback(@WizardFormBtnClick,1)); BtnSetFont(hDirBrowseBtn,ButtonFont.Handle); BtnSetFontColor(hDirBrowseBtn,$DAE369,$DAE369,$DAE 369,$B6B6B6); BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(3264 9)); Width:=0; Height:=0; end; with WizardForm.GroupBrowseButton do begin hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,Left+ 150,Top+55,Width-40,Height+10,ExpandConstant('{tmp}\browse.png'),6, False); BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,W rapBtnCallback(@WFBtnEnter,1)); BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBt nCallback(@WizardFormBtnClick,1)); BtnSetFont(hGroupBrowseBtn,ButtonFont.Handle); BtnSetFontColor(hGroupBrowseBtn,$DAE369,$DAE369,$D AE369,$B6B6B6); BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32 649)); Width:=0; Height:=0; end; end; Last edited by Razor12911; 05-02-2013 at 05:45. |
|
#7
|
||||
|
||||
|
Hello.
I know to load image .jpg on installer, like example below: Code:
InnerNotebook.Hide;
OuterNotebook.Hide;
h:=WizardForm.Handle;
ImgLoad(h,ExpandConstant('{tmp}\1.jpg'),0,0,WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
ImgApplyChanges(WizardForm.Handle);
How can i load image .jpg on the uninstaller screen? Sorry my bad english. Last edited by Andre Jesus; 01-02-2013 at 06:46. |
|
#8
|
||||
|
||||
|
Quote:
Thank you man, but don´t work. Can you please revised the script? I think that problem is in var: Code:
var hback, hnext, hcancel :Longint |
|
#9
|
||||
|
||||
|
Quote:
This was the result: 1.jpg |
|
#10
|
||||
|
||||
|
Quote:
|
|
#11
|
||||
|
||||
|
Quote:
I will try to do this. This is complete? (see #158). Thanks. Last edited by Andre Jesus; 05-02-2013 at 02:19. |
|
#12
|
||||
|
||||
|
I'm having a problem with the music during installation.
If the operating system volume is at 30%, when I run the installer, it automatically goes to 100%. Could you suggest a code that does not affect the volume of operating system? This is the code I'm using: Code:
#include "botva2.iss"
#include "BASS_Module.iss"
procedure InitializeWizard();
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('CallbackCtrl.dll');
ExtractTemporaryFile('botva2.dll');
ExtractTemporaryFile('MusicButton.png');
ExtractTemporaryFile('Music.mp3');
BASS_Init(ExpandConstant('{tmp}\Music.mp3'))
BASS_CreateOnOffButton(ExpandConstant('{tmp}\MusicButton.png'), 20, 320, 36, 36, 4)
end;
procedure DeinitializeSetup();
begin
BASS_DeInit;
gdipShutdown
end;
Last edited by Andre Jesus; 05-02-2013 at 05:13. |
|
#13
|
||||
|
||||
|
check in bass script. It is best if you use 100 instead of another number.
this usually happens if you are using windows xp |
|
#14
|
||||
|
||||
|
Quote:
Test it. |
|
#15
|
||||
|
||||
|
Can you please show an example?
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| INNO TROUBLESHOOT - Tutorials and Answers about INNO Setup | REV0 | Conversion Tutorials | 129 | 21-05-2021 05:51 |
| INNO TUTORIAL - Using Unicode and ANSI Versions of INNO Setup | REV0 | Conversion Tutorials | 51 | 26-03-2015 06:57 |
| Frequently Asked Questions | Joe Forster/STA | PC Games - Frequently Asked Questions | 0 | 29-11-2005 09:48 |