|
|
|
|
#1 |
|
Junior Member
Join Date: Jul 2006
Posts: 30
|
Use the default Vista font?
Is there a chance that NSIS can be fixed to use the default font for the OS instead of "MS Shell Dlg" or "MS Shell Dlg 2" fonts. For instance the default on Vista is Segoe UI 9.75pt.
The setting is stored in the Advanced Appearance dialog; the "Message Box Text". I did a bit of research and I found out that the only way you can retrieve the User's Font and Font size preferences (Vista and above) is by using the GetThemeFont API. (From: msdn2.microsoft.com/en-us/library/aa511282.aspx ) And here's the MSDN page for the GetThemeFont API: msdn2.microsoft.com/en-us/library/bb759745(VS.85).aspx I know this will probably take a big code change, but the Font subtleties would be a nice thing to have in NSIS. |
|
|
|
|
|
#2 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
the problem afaik, is that not only is it a different font (if that was the only problem, MS Shell Dlg would have worked) it is also a different size, so you need a special set of dialog resources just for Vista (or tweak the resource in memory)
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#3 | |
|
Junior Member
Join Date: Jul 2006
Posts: 30
|
Quote:
Because if it already does dynamically resize, then it's just a matter of reading in the user's font preference using the GetThemeFont API for Vista+ systems. If NSIS doesn't dynamically resize based on font size and DPI settings, then perhaps this is a bigger problem that needs to be addressed first. Though, this is easy for a backseat programmer to say. If I have some time I might start fiddling with the source to see if I can come up with anything. |
|
|
|
|
|
|
#4 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
MS Shell Dlg maps to MS Sans Serif on 9x/NT4 and Tahoma on 2k/XP. NSIS does not do any kind of font selection, its done by the dialog manager.
NSIS dialog resources (like most) contain the line: FONT 8, "MS Shell Dlg" this is part of the problem, Segoe must be used at 9pt and larger to look good. Dialog/control size is based on dialog units, and dialog units are based on the size of the current font. So, you can't change the font after the dialog has been created since its created with a 8pt font size. I don't know a good solution. IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#5 | |
|
Junior Member
Join Date: Jul 2006
Posts: 30
|
Quote:
There's some interesting discussion here: http://blogs.msdn.com/michkap/archive/2006/06/11/626100.aspx Is there a way to modify the dialog resource's font before it's loaded, that way all child controls inherit the set font? If that were possible, then the only other (mountainous) hurdle would be to scale the dialog size, buttons size, and text box sizes. It seems even the easy solutions are a lot of work. I'd forgotten how much a pain working with raw windows resource is. C# has softened me. |
|
|
|
|
|
|
#6 |
|
Senior Member
Join Date: Dec 2004
Location: Turkey
Posts: 447
|
There is: you have to set "MS Shell Dlg 2" in dialog resources. And for e.g. the MUI you can select a different modiyfied dialog resource, see somewhere in documentation.
TIP: Somtimes if you install fonts, the Windows fontcache get corrupted. Clear you fontcache on the machine you test your installer on. Best to test your script on a separate clean PC, where you know nothing is tweaked or otherwise broken. Give a sample script and I'll see what I can do... "Just do it" |
|
|
|
|
|
#7 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
|
AFAIK, MS Shell Dlg 2 does not translate into Segoe UI
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#8 | ||
|
Junior Member
Join Date: Jul 2006
Posts: 30
|
Quote:
Quote:
|
||
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|