|
-
Aug 16th, 2007, 03:07 AM
#1
Thread Starter
Member
frmMain.Font = (How i Can Load a Font From Resource) ?
Is it possible to load a font in my form from a resource file...?
I made a search in the vb-forums but i only found that you can load a font from a file...
Can anybody help me out...?
This is the link to load a font from file:
http://www.vb-forums.com/showthread....=font+resource
-
Aug 16th, 2007, 03:16 AM
#2
Re: frmMain.Font = (How i Can Load a Font From Resource) ?
Hi BladeM. What's the point of doing that? I share the opinion of James Stanich.
-
Aug 16th, 2007, 04:46 AM
#3
Thread Starter
Member
Re: frmMain.Font = (How i Can Load a Font From Resource) ?
Hi there too...
The point is that i want to use a font in text boxes for better interface...but the problem is that if someone else gonna use it he must have installed that specified font in i used,otherwise the font will change auto to windows default like "Times New Roman"
Also i don't want to share the font file with the exe.
That is why i want the font in the resource...
-
Aug 16th, 2007, 05:17 AM
#4
Re: frmMain.Font = (How i Can Load a Font From Resource) ?
you just need to check the fonts collection to see if your font is installed, then if installed set that font, if not use some other, no need to use a resource file for this
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Aug 16th, 2007, 05:38 AM
#5
Thread Starter
Member
Re: frmMain.Font = (How i Can Load a Font From Resource) ?
westconn1 i think you didn't understand exactly...
I have a project...
I set the frmMain.font = "(one font i have downloaded from the internet)"...
Now i compile the project i run the executable to my pc and all ok the text box preview the font i used(because the font is installed into Windows/Fonts directory),but if i send to my brother's pc he can't see the text box with the "(The Font From Internet)" because he don't have the font installed into Windows/Fonts directory...
The problem is that if i publish the project the third person who is gonna use it he must have installed the font in case to view the text box with the font i have used in my project
Note: I Don't want to share the font with my executable...
-
Aug 16th, 2007, 05:58 AM
#6
Re: frmMain.Font = (How i Can Load a Font From Resource) ?
that is exactly what i suggested in form load you put code to check if that font is installed, if it is set the textbox to use it, if not set the textbox to use some base font
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next
dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part
come back and mark your original post as resolved if your problem is fixed
pete
-
Aug 16th, 2007, 06:02 AM
#7
Re: frmMain.Font = (How i Can Load a Font From Resource) ?
Yep... same here.
You compile only the .exe. Within the distribution.exe you should add the font. When installing your app, install the font, in the Windows-Font folder and Register.
-
Aug 16th, 2007, 09:15 AM
#8
Thread Starter
Member
Re: frmMain.Font = (How i Can Load a Font From Resource) ?
 Originally Posted by westconn1
that is exactly what i suggested in form load you put code to check if that font is installed, if it is set the textbox to use it, if not set the textbox to use some base font
Yes but i want the 3rd person who gonna use the proggie to view the textbox with the font i have downloaded from internet (with or without having the font installed in his fonts directory)...
Thats why i am asking:
Is There Any Possible Way to Use A font From A Resource File...?
 Originally Posted by Radjesh Klauke
Yep... same here.
You compile only the .exe. Within the distribution.exe you should add the font. When installing your app, install the font, in the Windows-Font folder and Register.
I don't want to share/give the font to the 3rd person...
I think u have understand what i am trying to do...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|