Custom font size

Windows allows users to set their fonts and icons at 125% or 150%. What is the simplest way to handle this? I can detect the font size, then scale every other item up to match, or scale the fonts down, which defeats the user’s purpose. Both of these options are very tedious. Is there another option?

The fonts setting option in the Fonts control panel is for the desktop only.

You mean you want to change the font size in your app the same way ?

In any Xojo application I compile, the fonts are cut off because they are too big if the user has gone into

Control Panel > Appearance and Personalization > Display

and changed to “Medium - 125%” or “Large - 150%”

In which version of Windows are you seeing this ?

In Windows 10, these settings change the whole application window size, so everything is bigger and text is not cut off. Apparently, Xojo scales the entire app window like if it was displayed with a lower resolution. The font size itself does not change.

If the font size changes, then you can detect it and take action either to keep the font size smaller, or to increase the size of controls to fit. But it may interfere with your layout.

I am seeing it in Windows 7. I haven’t tested with Windows 8 or 10. I currently detect font size and take action to keep the font size smaller, but this is tedious. I was just hoping for an easier solution. I don’t understand why Microsoft allows this. Why not make everything bigger?

I just checked. Indeed, Windows 7 is kind of dumb. It changes the font size but not the application size. Windows 10 makes everything bigger, although controls lose crispness because it renders as an inferior resolution.

I guess you want to try with Windows 8 and 8.1 to see which way it goes.

For Windows 7, you could change everything yourself with something like this based on the size of the font. Use a flag to do it only once in the windows open event, for instance.

Admittedly, you already have found that the font is 125% bigger

for ii as integer = 0 to self.ControlCount-1 self.control(ii).left = self.control(ii).left*1.25 self.control(ii).top = self.control(ii).top*1.25 self.control(ii).width = self.control(ii).width*1.25 self.control(ii).height = self.control(ii).height*1.25 next self.width = self.width * 1.25 self.height = self.height * 1.25

Thanks Michel, that is a more elegant solution than I what I am currently using. What a paint. Not only do I need to detect if it is running on Windows, and I have to find which version.

Dave S posted a convenient method here :
https://forum.xojo.com/2239-how-to-determine-os-which-version-and-which-ver-of-windoz

The result is quite often: BLURRY ! Think the Windows 10 approach for scaling is not going to make everybody happy. You have a choice: 1. Perfect size of all shapes, but text is too small 2. everything looks blurry with lots of applications, including Xojo.

I agree, as I said before, it shows the app as if your screen suddenly had a lower resolution, hence less definition. Not pretty when one bought a large screen and a high definition graphic card.

My own solution within one app is using RubberViews to scale everything while keeping the full resolution. That way one can have a perfect rendition even in full 4K.

Unfortunately, the scale option of Windows is used by a lot of people.

Somebody at Microsoft must have seen Rubberviews the potential of it. Now it’s integrated :slight_smile: :slight_smile: :slight_smile:
But unfortunately, lot’s of people don’t want everything scaled, they just want use just a bit bigger font.
I checked with a new installation of Windows 7 here at the office and learned that 125% was the recommended setting those days.

[quote=213926:@Joost Rongen]Somebody at Microsoft must have seen Rubberviews the potential of it. Now it’s integrated :slight_smile: :slight_smile: :slight_smile:
But unfortunately, lot’s of people don’t want everything scaled, they just want use just a bit bigger font.
I checked with a new installation of Windows 7 here at the office and learned that 125% was the recommended setting those days.[/quote]

Unfortunately, What Microsoft does is not Rubberviews. It is more akin to the Atari lens.

The scaling mode enlarges not only the fonts, but also the size of pixels. Hence the blurriness of the UI.

Right. Which they had implemented the Rubberviews-technique.

There is a way out of scaling to change font size for title bars, menus, message boxes, palette titles, icons and tooltips.

In Control panel open Display
Click “Make text and other items larger or smaller”

or

In Settings select Display, click on Advanced display settings
Click Advanced sizing of text and other items

Declares can change the font size for these elements within an app as well. I am not entirely sure the user will expect or appreciate that, though.

There is another consideration which I am addressing in may latest app : I am following the design guidelines for Modern UI (“Metro”) where old fashion menus are replaced by ListBoxes, as well as Dialogs, and most everything, so it facilitates touch (larger buttons, etc.). As a result, I do not need to worry about the minuscule controls la XP.

In the Modern UI, an app uses panes and full screen (full window) design, but the past abundance of windows is proscribed in favor of a much cleaner, much closer to iOS in many ways interface. Then the app can fix whatever font size and address the screen to the best of its resolution.

Hi Michel, Tomorrow I’ll bring my laptop of course Need you to optimize the graphics of the Win10 VM for me. Save journey to beautifull Scheveningen.

Looking forward to meet you in person in the beautiful resort :slight_smile:

Unfortunately, it seems while not particularly cold, the weather maybe a little wet. Which should not be too much of a problem, as we will mostly stay indoors :wink: