- NSIS Discussion
- Weird font question
Archive: Weird font question
cchian
27th March 2002 01:13 UTC
Weird font question
Is there a way to use NSIS to code the following?:
1. Open the Fonts folder
2. Open the Arial.ttf font (or any other font)
3. Click on Done
For some reason I still haven't figured out, very few users of our software have a problem printing. The problem is that the text printed is a little larger and/or more spaced out than what it was intended (Looks like it is the bold text which prints slightly oversized). This causes some text to overwrite other text. What I found out is that if you perform the steps listed above, somehow it fixes the problem. Could this be a registry problem I can "fix" with NSIS? The application is written in Visual Fox Pro.
-Carlos
Pomflain
27th March 2002 01:36 UTC
Hmm...
Is this an installer problem, or an application problem? I've run into a similar problem in Win32 programs before, depends on if the person is using Small Fonts or Large Fonts in their display settings. The "solution" was to make things larger on the build system, or to build on a 9x kernel system. Not sure if that's what you mean, but that sounds like the same kind of problem I was having there.
cchian
27th March 2002 03:16 UTC
Re: Hmm...
Originally posted by Pomflain
Is this an installer problem, or an application problem?...
I don't know if this is an installer or an application problem. The application is built on a 9x system. The problem can occur in any version of Win32. Somehow clicking on a font and then on "Done" fixes it. I am curious to know what exactly happens when you click on Done.
Pomflain
27th March 2002 06:53 UTC
Re: Re: Hmm...
Originally posted by cchian
I don't know if this is an installer or an application problem. The application is built on a 9x system. The problem can occur in any version of Win32. Somehow clicking on a font and then on "Done" fixes it. I am curious to know what exactly happens when you click on Done.
No I meant in the installer itself, or in your application. I'm going on the presumption you mean in your application.
cchian
27th March 2002 19:29 UTC
Re: Re: Re: Hmm...
Originally posted by Pomflain
No I meant in the installer itself, or in your application. I'm going on the presumption you mean in your application.
Hi Pomflain, I am not sure what you meant. Can you refrase it for me again?
Thanks, :)
Carlos
cchian
30th March 2002 06:10 UTC
Pomflain,
Maybe the post by KiCHiK titled Fonts will do the trick. See this tread:
http://forums.winamp.com/showthread....ferrerid=24442
Pomflain
30th March 2002 06:32 UTC
Re: Re: Re: Re: Hmm...
Originally posted by cchian
Hi Pomflain, I am not sure what you meant. Can you refrase it for me again?
Thanks, :)
Carlos
Ok, you said you were having a problem with the printing wherein the text was too large for some users. If those particular users happen to be using the large fonts setting in Control Panel/Display, that could be what the cause of your problem is. I figure you mean in your application since I don't see much reason to be printing something from the installer.
Thanks for pointing out the other thread, but I don't have any problems like that. I have run into problems with the large/small font issue before and I've seen others have problems, so that's why I mentioned it. It's not something that is particularly obvious.
Hope that was a bit clearer.
Pomflain
30th March 2002 06:41 UTC
Re: Re: Re: Re: Hmm...
Originally posted by cchian
Hi Pomflain, I am not sure what you meant. Can you refrase it for me again?
Thanks, :)
Carlos
Ok, you said you were having a problem with the printing wherein the text was too large for some users. If those particular users happen to be using the large fonts setting in Control Panel/Display, that could be what the cause of your problem is. I figure you mean in your application since I don't see much reason to be printing something from the installer.
Thanks for pointing out the other thread, but I don't have any problems like that. I have run into problems with the large/small font issue before and I've seen others have problems, so that's why I mentioned it. It's not something that is particularly obvious.
Hope that was a bit clearer.
cchian
30th March 2002 16:21 UTC
Re: Re: Re: Re: Re: Hmm...
Originally posted by Pomflain
Ok, you said you were having a problem with the printing wherein the text was too large for some users. If those particular users happen to be using the large fonts setting in Control Panel/Display, that could be what the cause of your problem is. I figure you mean in your application since I don't see much reason to be printing something from the installer.
Yes, the problem is printing from the application. I am still curious to find out why clicking on the (for example) Arial font and then on Done fixes the printing problem. Fortunately, it is an easy fix, but would be great if our developers could somehow do it behind the scenes (like during installation) so users don't have to contact us with the problem on the first place. I feel users shouldn't have to encounter this issue in the first place. In other words, the problem is in our end and not the users.
As a side note, I encountered this same printing problem with a new Windows XP system that has not had its display settings changed from the default.
plaztic
9th April 2002 15:34 UTC
There's an application called AutoIt. It's a quite powerful scripting tool. You could automate the whole font session with this.
I sometimes use it together with NSIS to automate installations, rather install silently.
Oh, forgot to add the address: http://www.hiddensoft.com/autoit/
\plaz
kichik
9th April 2002 21:00 UTC
Hi Carlos!
I believe this NSIS code should do the same trick:
!include "C:\\Program Files\\NSIS\\WinMessages.nsh"
>ExecShell open "$WINDIR\\Fonts\\arial.ttf" SW_SHOWMINIMIZED
loop:
Sleep 100
FindWindow$0 "FontViewWClass"
IntCmp $0 0 loop
SendMessage$0 ${WM_CLOSE} 0 0
Goto done
done:
KiCHiK
(edit): It is recommended you take the font diretory from the registry (HKCU\Software\Microsoft\CurrentVersion\Explorer\Shell Folders\Fonts).
cchian
10th April 2002 05:25 UTC
Thanks for the tips!
Lately I have been trying to figure out why the simple action of opening the control_panel\fonts\arial.ttf font fixes the problem. I have done a comparison of the registry and have almost concluded that the problem is that the required fonts (arial narrow and variants) are being copied to the fonts directory, but are not being registered with Windows.
It think I will modify and use Kichik's code to do the trick, I just need to figure out exactly what code I need to write to register the fonts or do the equivalent of just opening and closing the fonts folder silently.
Carlos
kichik
10th April 2002 14:16 UTC
If you want to reregister the font (although Windows does it on its self when it boot) you can use the DLL I have written and uploaded in the post you yourself referenced to.
http://forums.winamp.com/showthread....ferrerid=24442
KiCHiK