I've learn how to manage different DPI settings the hard way, so that at runtime my applications are properly displayed.
But there is still a big issue with Design time Visual Studio.
Say I build an application at 96 dpi and I switch my display to 120 dpi for testing purposes.
Now IF I open a form designer at 120 dpi, the form is resized according to 125%, the controls moved aso! :-(((
So I try to avoid reopening forms, but that's NOT a nice solution, isn't it?
Is there by any chance a design time setting to prevent form to resize?
Not a solution but possibly a workaround: do not test on your computer but on a VM or other computer and do not open the solution on a computer with big fonts.
And we found that we cannot use the AutoScaleMode = Dpi.Font setting. That will randomly resize forms when we open them in the designer. Dpi or None seem to work.
Although this question is already old, I want to share my workaround.
Keep the Form’s AutoScaleMode = Font. This works fine, if you control the rest correctly.
Set in your Forms Designer: Font = MS Sans; 11px. Basically, specify your Fonts in Pixel, instead of Points. So Visual Studio won't re-scale anything if the system's DPI change.
In the Forms Ctor, after InitializeComponent, re-set: Font = SystemFonts.DefaultFont. Now, at run time, Fonts will use Point-based sizes again, and you get nice high-DPI GUI.
Enable DPI-Awareness, either through a manifest or by API function SetProcessDPIAwareness
You can find the details of my (hard) learning trail on my Blog: http://www.sgrottel.de/?p=1581&lang=en
Related
I'm trying to make VS Code editor to look exactly like Visual Studio. I made sure the font settings are exactly the same, however text still renders differently in VS Code (it seems "lighter").
Is there any way to fix this issue?
In the image below the top text is copied from Visual Studio while the bottom one is copied from VS code.
I know the difference is subtle but is still pretty noticeable.
Font rendering in VSCode has been a reoccurring issue throughout a good portion of the editors life time. Font rendering, especially in portable GUI's, is affected by several different layers, for example:
Your Graphics Card can affect the way font is rendered (you can try adjusting the graphic cards settings manually).
Your Monitor, obviously, affects rendering. In fact your monitor has a huge impact. (Try playing with your Monitor's Settings)
The color settings that are offered by your OS may have an impact (often times the color settings are the same as the graphic card settings though. Which means you can just use your OS's GUI to adjust your cards settings in some cases (Not on Ubuntu though))_
Somethings are out of your control, like:
VSCode, it is written using Electron v6. Not only does Electron impact font rendering, but when VSCode switched it Version 6 a lot of people reported a decrease in the editors font rendering quality.
VSCode also implements Anti-Aliasing tools, but as far as I can tell, they auto configure, so you have no control over this. These tools are likely to be one of the biggest causes to the difference in rendering you see, between VS IDE & VS CODE. There is a tool however that may give you some control over the Visual Studio side of rendering that I share a link to below. And just as an FYI, the Anti-Aliasing that VSCode uses is called Sub-pixel Rendering, which is something that Visual Studio doesn't implement as far as I can tell.
The Area You Have the Most Control in:
There is ONE tool/thing that you have 100% control over, that also greatly affects font-rendering, and that is the font that you decide to use. When choosing a font, you have the choice of equipping an OTF, or a TTF. In my personal experience, OTF's render better 90% of the time. The difference is in how they are created.
TTF fonts are made using quadratic Beziers.
OTF fonts are made using cubic Beziers.
Links above are the same
Fonts use something called font-hinting
Font hinting. Essentially font-hinting is a list of instructions that dynamically changes the way a font is rendered, by using the rasterized grid background as a parameter. adjust the display of an outline font so that it lines up with a rasterized grid. Choosing a quality font equipped with good hinting is critical for non-blurry readable text.
Many people choose font because like the way they look, or the italic version of the font they use is popular. When choosing a font, it is extremely important to choose, not the coolest one, but the one that renders with the highest quality, and is the easiest for you to read.
Well Rendering Fonts:
Not only are their fonts that render well, with ligature support, but the best rendering fonts are always free IMO. Bellow are Fonts that use font hinting and have top notch rendering abilities.
JetBrains Mono (JetBrain's Font & My Personal Favorite)
Cascadia Code (Microsoft's Programming Font from 2019)
Fira Code (Not that old, but not that new either. Is loved by many.)
Fira Mono (No Ligatures, Different Font than Fira Code)
Consolas (A classic)
Menlo (Another Classic)
The top 4 are at the top of the list because they receive updates ever few months. I don't think Menlo & Consolas receive regular updates, but they aren't left forgotten either, the are updated every year or two.
To finish with as solid of an answer as I can provide:
_"Getting VSCode to render like the Visual Studio IDE, is not something that you will probably get, with 100% satisfaction, getting an exact match with all of the different factors is just an extremely and possibly impossible thing to due. You can probably make the way the two pieces of software render, more a like, not in functionality, but in looks. It would probably help a great deal to make sure that everything that affects rendering is up to date, editor, IDE, fonts, tools, ect... From their you can try different versions, and see if maybe an older version of VSCode rendered in a way that is preferable to you. You should also play with your monitors settings. I have found that I can accomplish a great deal just through the buttons under the face of my monitor. Check Visual Studio for any rendering settings it might have, VSCode doesn't have much available, but maybe Visual Studio IDE does (I haven't used the IDE in 5 years so IDK if it does).
On a final note:
Their is one tool that could help you, I haven't used it, because it isn't for VSCode, it's for Visual Studio, but it might give you more control than you have now. The tool is called..."_
Text Sharp (Click Here to see it in the VS Market Place)
Can I change Qt Creator's (latest version: 4.14.0, Windows 10) general GUI font size (or scaling)?
The problem is, my system display scaling is set to 250% and I have two options for high DPI compatibility in Qt Creator, but both have issues:
I can disable Creator's built-in High DPI Scaling and force System (Enhanced) in the Windows compatibility settings:
Or I can enable Creator's built-in scaling and leave the Windows compatibility scaling override turned off (Application scaling):
In the former case, it's actually a size I find very comfortable except the cursors are all too small and Designer gets wonky (plus it's tricky to layout GUI's because apps all run in System (Enhanced) mode from Creator).
In the latter case, the cursors and Designer work, and it's nice to not have heavy anti-aliasing everywhere, except the GUI font is too large for me, and everything feels cramped (especially the top bar, and the left bar reminds me of one of those old school children's telephones with the huge buttons). Plus the general GUI font is different enough in size from my editor font that the whole thing just feels jarring and kind of stresses me out.
So what I think I'd like to do, ideally, is use application scaling like in the latter example, but just shrink the GUI font size to match the former.
I think I ran through all the options thoroughly, and all I can find is settings for the editor window and the console, but not the rest of the GUI.
To be honest, I'm actually not entirely sure why they don't look the same; my expectation was that Qt's built-in High DPI support would take the scale factor into account in the same way that Windows' System (Enhanced) mode does, but I'm sure it's more complicated than that.
The problem is Qt automatically round up your 250% scaling to 300%. For Qt Creator application, you can create a "QT_SCALE_FACTOR_ROUNDING_POLICY" environment variable, and set it to "PassThrough". You can find details in this question: Qt Creator "too big" on 3840x2160 and 150% scaling on Windows 10.
It's also worth noting that Qt also behaves like this coding a GUI program. This can be fixed with:
QGuiApplication::setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy::PassThrough);
I need help with the text size for my outlook add in.
I have a table view in my add in which is unreadable with bigger screen resolutions. Is there a way to zoom so the font size gets bigger?
With a selected email from my inbox it is possible to zoom with the zoom slider in the bottom right corner. Is there a way to activate the zoom slider at any time? Or is there any way to access and change/set the font size outside of the email body?
It looks like your add-in is not DPI-aware. Desktop applications using older Windows programming technologies (raw Win32 programming, Windows Forms, Windows Presentation Framework (WPF), etc.) are unable to automatically handle DPI scaling without additional developer work. Without such work, applications will appear blurry or incorrectly-sized in many common usage scenarios. To make things working better you must read the following articles:
High DPI Desktop Application Development on Windows
Writing DPI-Aware Desktop and Win32 Applications
Most probably the table view is used on a windows form, see Automatic scaling in Windows Forms for more information.
I create my programs on Ubuntu 12.04 and compile them on Windows (when necessary).
Recently I noticed that my Lazarus projects look different on Ubuntu and Windows. The problem is on Windows XP, 7 and 8. I'm not sure if Vista looks the same.
For example, group boxes containing radio buttons look shrunk in height, thus hiding parts of the components.
Now I have to edit this forms on Windows before compiling for those platforms. What's worse is that when I bring these project back to Ubuntu, the forms looks unnecessarily stretched out (in height).
Is there a solution to this?
Thanks!
It is easily to check if the controls themselves have the same height(just query their left and top properties and dump it in a memo or log for verification)
If that is ok, it is probably the font. Default fonts are subject to themes, and sometimes readability/disability settings.
Consistent cross-platform look is not a trivial task and does not come at no-cost.
Read http://wiki.freepascal.org/Autosize_/_Layout, especially the part that can scale controls on your form depending on the font size that the end user has configured in the Control Panels
Read few chapters from Google: "windows dpi aware applications"
Today, I installed Visual Studio 2010 Professional on a new laptop with a fresh Windows 7 Ultimate 64-bit install. I, being quite used to the look of Visual Studio 2010, instantly spotted that something was wrong. It seems that the Visual Studio application is "zoomed in", in a way. The text is much larger (even though it says that the zoom level is 100%, and the text size is 10, which is the same as what I used before), and generally, so are the other windows like the Solution Explorer and Output console. The quality of the icons and images is also very bad.
Here are two comparison images (I wasn't allowed to post images, so some links will have to do):
This is the look that I'm used to. I see plenty of text in the windows, and the icons are fine.
http://i51.tinypic.com/2mq8dau.png
This is what greeted me when I installed VS2010 on my new laptop. The icons look stretched, and I can fit a lot less code in the window.
http://i56.tinypic.com/35k0fo4.png
The screen resolution on my old computer is 1920x1200 and the resolution on my new computer is 1920x1080. (I resized the VS window on my old computer to about 1920x1080 to show the difference).
It looks like my image host resized the images as well, but you should still be able to see the difference.
Has anyone had the same problem? I'm hoping it's just some visual settings. If anything is missing, I will be happy to provide more information.
Thanks in advance.
It seems your Font Size DPI is at 150% on the second screenshot. If you right click on the Desktop and select Personalize > Adjust Font Size (DPI)* you should be able to see what it is currently set at.
Check
that your screen is at native resolution (there can only be one, the native max)
that your OS font is
at normal size
antialiasing (i believe windows calls that cleartype or something)
the screen density is 'standard' (usually 96DPI IIRC)
I strongly suspect the latter (the DPI setting). It's under
Desktop Properies
Display Properties
Display Settings
Advanced
DPI Settings
in my Windows
If you hold down Ctrl and roll the wheel on the mouse it will zoom it in and out. You can then get the desired size that you want. I hope that solves it.
EDIT:
Also if you go to Tools->Options and then under Environment->Font and Colors you can then customize the font size for the whole application.
I didn't find any setting that could case this effect.
Did you try reseting the settings of visual studio (Tools - Import and Export Settings) or Import the settings of your working maschine.
Maybe you have configured big-icons / big-font in windows?