It is currently March 28th, 2024, 11:04 am

Segoe UI Variable font - can't get the correct size.

Get help with creating, editing & fixing problems with skins
Post Reply
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Segoe UI Variable font - can't get the correct size.

Post by StArL0rd84 »

I am making a skin that mimics Windows 11 design down to the pixel.
And I found out that the font used is 'Segoe UI Variable'.
The letter height should be 10 pixels precisely to match.
But no matter the size I set it to in the skin, it does not match.
Its either 9 or 11 pixels heigh.

You might think I'm nitpicking, and how much of a difference does one pixel really make.
But that one pixel have a even bigger impact on the other dimension.
And when you look at it, side by side, it's truly obvious.
10high.jpg
I just wonder where the disconnect is.
Like, how come, when in Photoshop I can set it to 12 and have it be 10 pixels high, but not in RM?

This post by @lilshizzy goes over the EXCACT same issue:
https://forum.rainmeter.net/viewtopic.php?t=8988
He even needed his font to be 10 pixels high like I do.
But different font, and that was 11 years ago.

So I am bumping that post here to see if we gathered some experience from then to now to remedy this somehow.
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Segoe UI Variable font - can't get the correct size.

Post by SilverAzide »

StArL0rd84 wrote: November 20th, 2022, 8:42 am I am making a skin that mimics Windows 11 design down to the pixel.
And I found out that the font used is 'Segoe UI Variable'.
The letter height should be 10 pixels precisely to match.
But no matter the size I set it to in the skin, it does not match.
Its either 9 or 11 pixels heigh.

You might think I'm nitpicking, and how much of a difference does one pixel really make.
But that one pixel have a even bigger impact on the other dimension.
And when you look at it, side by side, it's truly obvious.

I just wonder where the disconnect is.
Like, how come, when in Photoshop I can set it to 12 and have it be 10 pixels high, but not in RM?
Under your Windows Display Settings, do you have your scale set to 100%, or something else?

The reason I ask is that at 8 points, the Sego UI Variable font on my machine -- which is at 100% scaling -- is exactly 10 pixels for the letter/symbol height. (I am assuming you don't care about the "white space" above and below the letters; in the below code/screenshot, I tinted the background red so you could see the actual font height including the white space.)

SegoeUIVariable.png

Code: Select all

[Rainmeter]
AccurateText=1
BackgroundMode=2
DynamicWindowSize=1
SolidColor=0,0,0,255
Update=1000

[StyleText]
AntiAlias=1
FontFace="Segoe UI Variable"
FontColor=255,255,255
MeasureName=MeasureString
SolidColor=255,0,0,64
X=0
Y=20r

[MeasureString]
Measure=String
String="The quick brown fox jumps over the lazy dog."

[Meter1]
Meter=String
MeterStyle=StyleText
FontSize=6
Text="%1 = 6pt 8px"
X=0
Y=0

[Meter2]
Meter=String
MeterStyle=StyleText
FontSize=7
Text="%1 = 7pt 9px"

[Meter3]
Meter=String
MeterStyle=StyleText
FontSize=8
Text="%1 = 8pt 10px"

[Meter4]
Meter=String
MeterStyle=StyleText
FontSize=9
Text="%1 = 9pt 12px"

[Meter5]
Meter=String
MeterStyle=StyleText
FontSize=10
Text="%1 = 10pt 13px"
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: Segoe UI Variable font - can't get the correct size.

Post by StArL0rd84 »

SilverAzide wrote: November 20th, 2022, 4:14 pm Under your Windows Display Settings, do you have your scale set to 100%, or something else?

The reason I ask is that at 8 points, the Sego UI Variable font on my machine -- which is at 100% scaling -- is exactly 10 pixels for the letter/symbol height. (I am assuming you don't care about the "white space" above and below the letters; in the below code/screenshot, I tinted the background red so you could see the actual font height including the white space.)
Hmm, must be something else than scale.
all.png
Maybe something's different on my Windows build.
winver.png
8.png
9.png
10.png
11.png
all.png
Attachments
Scale.png
User avatar
SilverAzide
Rainmeter Sage
Posts: 2588
Joined: March 23rd, 2015, 5:26 pm
Contact:

Re: Segoe UI Variable font - can't get the correct size.

Post by SilverAzide »

StArL0rd84 wrote: November 21st, 2022, 5:32 pm Hmm, must be something else than scale.

Maybe something's different on my Windows build.
Oh wait... you are not including the descenders, based on how you drew your selection boxes. So you are looking for 10 pixels between the baseline and the ascent. So that would be the 10 point font in my screenshot.

You drew your last selection box "incorrectly"; you chopped off one pixel in height (the top of the "l" and "d" in "lazy dog" is one pixel taller than your box). I don't know why the numbers are not tall as letters at 10 points. At 11 points, the numbers (and letters) are both 11 pixels in height, which is more than you wanted.

The only way I know of to get the exact 10px height for numbers that you wanted is to cheat. And by cheat, I mean use TransformationMatrix. Adding a very tiny amount to the scaling of the meter will keep the font height the same, but the numbers will be 10 pixels in height just like the letters. For example, scale the height to 102% (leave the width at 100%):

TransformationMatrix=1.00;0;0;1.02;0;0
User avatar
sl23
Posts: 1140
Joined: February 17th, 2011, 7:45 pm
Location: a Galaxy S7 far far away

Re: Segoe UI Variable font - can't get the correct size.

Post by sl23 »

Not something I've tried, but I remember seeing in word processors about setting font size as say *.5, does Rainmeter accept decimals wrt font sizing? Maybe that could help.
User avatar
Brian
Developer
Posts: 2673
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: Segoe UI Variable font - can't get the correct size.

Post by Brian »

sl23 wrote: December 6th, 2022, 10:47 am Not something I've tried, but I remember seeing in word processors about setting font size as say *.5, does Rainmeter accept decimals wrt font sizing?
Rainmeter does not accept decimal values for the FontSize or InlineSetting "Size" options......at least not yet....
Rainmeter_3CQYAETpQW.png
Obviously there will be slight differences with different fonts, DPI settings, screen resolution settings, etc. Also, the AccurateText option might affect the output a little as well.
-Brian
Post Reply