为什么PC的缩放比例不同? [英] Why does scaling of controls differ between PC's?

查看:363
本文介绍了为什么PC的缩放比例不同?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过隐藏一些元素给用户一个干净简单的界面。只有一个小箭头表示他可以扩展主菜单栏的某些部分。当所有的关闭它看起来像这样:





当您打开所有内容时,如下所示:





每个箭头都是一个SpeedButton,它位于左侧一个小组。通过点击按钮,宽度将在设计时(打开)的速度按钮(关闭)的宽度和面板的宽度之间切换。面板在设计时的宽度存储为常数。程序show_hide_controls处理这个:

  procedure TCompose_Main.show_hide_controls(key:string; Button:TSpeedButton; Panel:TPanel; width:Int32 ); 
begin
如果GPA.iKey [key] = 1
那么Panel.Width:= width //显示面板,设置面板设计宽度
else Panel.Width:= Button 。宽度; //隐藏面板,设置为按钮宽度
Button.Glyph.Assign(nil);
Images_Left_Right.GetBitmap(GPA.iKey [key],Button.Glyph);
结束// show_hide_controls //

此例程调用如下:

  show_hide_controls('显示播放控制',//索引到面板显示/隐藏
Enlarge_Play,//速度请求放大/隐藏
Panel_Play,//面板显示/隐藏
cPlayWidth); //显示面板的宽度

现在有几个用户报告该面板的一部分被隐藏,如:





似乎操作系统(Windows 7)在缩放方面起了一些作用。我无法复制此错误。有没有人明白这里发生了什么?有没有一个整洁的方法来以独立于设置的方式来编程?



更新正如GDF在答案中正确指出的那样使用缩放的字体(控制面板>显示)。这在我的机器上有点怪异。将其更改为150%具有轻微的影响,而将其更改为125%会产生重大影响。你可能已经猜到我测试了第一个而不是第二个缩放。只有当用户报告从125%缩小到100%时,我可以在我的机器上复制他的错误。



我找不到字体和麻烦之间的关系有几个赞助者建议。我的系统仍然受到我对Courier(不是新的),Segoe UI,Tahoma和MS Sans Serif所做的所有测试:--D。也许间接地是因为控件可能被调整大小以适应文本。



如何处理?我不知道,我会开始尝试,如果我找到东西,会让你知道。



感谢大家的帮助!

解决方案

问题是我相信,你刚才说了答案。 Windows 7可以缩放某些字体。当您在PC上安装Win7时,会检查显示器的大小,并根据显示器的大小使默认刻度设置为100%或125%。问题是在同一时间,它会将字体文件安装到计算机上。它对于某些字体使用不同的默认字体的不同字体文件。



我的猜测是您的应用程序正在使用MS Sans Serif ...这是获得不同字体文件安装的字体之一,具体取决于Win7正在使用的大小(为了验证这一点,您的用户告诉您希望缩放设置为默认值,您可以通过右键单击桌面并选择个性化然后选择



以下链接显示如何将使用中的字体文件更改回原始的
http://www.rlvision.com/misc/windows_7_font_bug.asp



但是,我会尝试下载这种字体,并更新布局元素,以便在Win7以及以前的操作系统中正常工作



这是我认为你正在处理的,因为你提供的信息有限...



更新
由于你提醒我,当你提到这个难题看起来在125%v 150%之间。我只是想确保你知道两个不同的MS Sans Serif文件在不同的尺度上看起来更好。其中一个字体文件看起来很棒,100%和150%,但可怕的是125%。另一个字体文件看起来很好,125%,但可怕的是100%和150%。



我不太清楚哪个字体文件是哪个,但我知道2歹徒是
1)SSERIFF.FON
2)SSERIFE.FON


I try to give the user a 'clean and simple' interface by hiding some elements. Only a small arrow denotes that he can expand some part of the main menu bar. When all is closed it looks like this:

When you open all it looks like this:

Each arrow is a SpeedButton thats sits on the left side of a panel. By clicking on the button the Width is toggled between the width of the Speedbutton (closed) and the width of the panel at design time (open). The width of the panel at designtime is stored as a constant. The procedure show_hide_controls handles this:

procedure TCompose_Main.show_hide_controls (key: string; Button: TSpeedButton; Panel: TPanel; width: Int32);
begin
   if GPA.iKey [key] = 1
      then Panel.Width := width         // show panel, set panel to design width
      else Panel.Width := Button.Width; // hide panel, set with to button width
   Button.Glyph.Assign (nil);
   Images_Left_Right.GetBitmap (GPA.iKey [key], Button.Glyph);
end; // show_hide_controls //

This routine is called as follows:

show_hide_controls ('Show Play Controls', // index to panel to show/hide
                    Enlarge_Play,         // Speedbutton requesting the enlargement/hide
                    Panel_Play,           // Panel to show/hide   
                    cPlayWidth);          // Width of panel when shown 

Now several users report that part of the panel is hidden, like:

It seems that the operating system (Windows 7) plays some tricks with scaling. I'm not able to duplicate this error. Does anyone understand what is happening here? And is there a neat way to program against this in a settings independent way?

Update As GDF rightly pointed out in his answer it has to do with the scaling of the fonts (control panel > Display). This behaves somewhat weird on my machine. Changing it to 150% has a minor impact while changing it to 125% has a major impact. As you might have guessed I tested the first and not the second scaling. Only when a user reported that scaling back from 125% to 100% I could replicate his error on my machine.

I could not find a relation between fonts and the troubles I have as was suggested by several respendents. My system is still suffering from all the tests I did with Courier (not new), Segoe UI, Tahoma and MS Sans Serif :-D. Maybe indirectly because the controls are probably resized to accomodate the text.

How to handle this? I don't know, I'll start experimenting and will let you know if I find something.

Thanks to you all for your help!

解决方案

If your problem is what I believe, you just stated the answer. Windows 7 plays with scaling certain fonts. When you install Win7 on a PC it checks the size of your monitor and makes the "default" scale setting either 100% or 125% depending on your monitor size. The problem is that at this same time it installs font files onto the computer. It uses a different font file for the different "default" for some of the fonts.

My guess is your app is using MS Sans Serif... this is one of the fonts that gets different font file installs depending on what scale Win7 is using as the (default).

To verify this have your users tell you want scale is set as the default, you can view this by right clicking the desktop and selecting "personalize" then "Display" at the bottom left.

The following link shows you how to change the in-use-font file back to the original http://www.rlvision.com/misc/windows_7_font_bug.asp

However, I would make an attempt to get off of this font and update the layout elements to work as desired on Win7 as well as past OSes

This is what I think you are dealing with given the limited amount of information you have provided...

Update Since you reminded me when you mentioned the different looks between 125% v 150%. I just wanted to make sure you were aware that the two different MS Sans Serif files looks better at different scales. One of the font files looks great at 100% and 150% but horrible at 125%. The other font file looks great at 125%, but horrible at 100 and 150%.

I don't quite remember which font file is which, but I know the 2 culprits are 1) SSERIFF.FON 2) SSERIFE.FON

这篇关于为什么PC的缩放比例不同?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆