It is currently March 29th, 2024, 6:28 am

Need font size change with WorkAreaWidth

Get help with creating, editing & fixing problems with skins
User avatar
gaffarsheikh
Posts: 14
Joined: December 2nd, 2019, 9:55 pm
Location: Dhaka

Need font size change with WorkAreaWidth

Post by gaffarsheikh »

Hi,
Please help for font size change with WorkAreaWidth.
*When my computer screen resolution change 1366x768 to 1920x1080. I want Rainmeter Skin all of text size will be small to big, Example for font 10 to 14.
Gaffar Sheikh
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Need font size change with WorkAreaWidth

Post by mak_kawa »

I am not sure about your actual skin, but generally speaking, you can get WorkAreaWidth by built-in Monitor variable #WORKAREAWIDTH#, and according to its value, you can change font size using IfCondition, like this;

Code: Select all

[Rainmeter]
Update=1000

[Variables]
GlobalFontSize=12

[measureWorkAreaWidth]
Measure=Calc
Formula=#WORKAREAWIDTH#
IfCondition=#CURRENTSECTION#=1366
IfTrueAction=[!SetVariable GlobalFontSize 10]
IfCondition2=#CURRENTSECTION#=1920
IfTrueAction2=[!SetVariable GlobalFontSize 14]
DynamicVariables=1

[someMeter]
Meter=String
FontSize=#GlobalFontSize#
DynamicVariables=1
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need font size change with WorkAreaWidth

Post by balala »

gaffarsheikh wrote: December 2nd, 2019, 10:11 pm *When my computer screen resolution change 1366x768 to 1920x1080. I want Rainmeter Skin all of text size will be small to big, Example for font 10 to 14.
Or beside mak_kawa's solution, here is another approach. Not sure in how many skins do you want to modify the font sizes, but in all of them you could replace the FontSize=10 (or 14) with this FontSize=(#WORKAREAWIDTH#/137). Using this formula the font size of the appropriate String meters will automatically adjusted according to the current screen resolution.
However I doubt this fixes all your problems, because in most cases changing the font size is far away from being enough, usually the skins has to be redesigned. But how can you do this, depends on a lot of things.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Need font size change with WorkAreaWidth

Post by mak_kawa »

This formula, divide WorkAreaWidth by constant ratio to font size, is unique and interesting. :-)
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need font size change with WorkAreaWidth

Post by balala »

mak_kawa wrote: December 3rd, 2019, 11:58 am This formula, divide WorkAreaWidth by constant ratio to font size, is unique and interesting. :-)
No, it's not unique at all. The idea is the higher is the resolution, the greater font size to get. The number you have to divide with has to be found, obviously 137 is just an example and probably will have to be adjusted.
User avatar
gaffarsheikh
Posts: 14
Joined: December 2nd, 2019, 9:55 pm
Location: Dhaka

Re: Need font size change with WorkAreaWidth

Post by gaffarsheikh »

mak_kawa wrote: December 2nd, 2019, 11:11 pm I am not sure about your actual skin, but generally speaking, you can get WorkAreaWidth by built-in Monitor variable #WORKAREAWIDTH#, and according to its value, you can change font size using IfCondition, like this;

Code: Select all

[Rainmeter]
Update=1000

[Variables]
GlobalFontSize=12

[measureWorkAreaWidth]
Measure=Calc
Formula=#WORKAREAWIDTH#
IfCondition=#CURRENTSECTION#=1366
IfTrueAction=[!SetVariable GlobalFontSize 10]
IfCondition2=#CURRENTSECTION#=1920
IfTrueAction2=[!SetVariable GlobalFontSize 14]
DynamicVariables=1

[someMeter]
Meter=String
FontSize=#GlobalFontSize#
DynamicVariables=1


Thanks for reply with solution. I need Several meters font size increase or decrease by different size. with computer screen resolution. [GlobalFontSize=12] make all meters font size are same. I need different Meter has to be different font size in increase or decrease with computer screen resolution. I hope, I explained that what I need.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
GlobalFontSize=12

[measureWorkAreaWidth]
Measure=Calc
Formula=#WORKAREAWIDTH#
IfCondition=#CURRENTSECTION#=1366
IfTrueAction=[!SetVariable GlobalFontSize 10]
IfCondition2=#CURRENTSECTION#=1920
IfTrueAction2=[!SetVariable GlobalFontSize 14]
DynamicVariables=1

[DayMeter]
Meter=String
Text= Wednesday 
FontSize=20
DynamicVariables=1

[MonthMeter]
Meter=String
Text=December 
FontSize=10
DynamicVariables=1

Last edited by gaffarsheikh on December 3rd, 2019, 11:20 pm, edited 2 times in total.
Gaffar Sheikh
User avatar
gaffarsheikh
Posts: 14
Joined: December 2nd, 2019, 9:55 pm
Location: Dhaka

Re: Need font size change with WorkAreaWidth

Post by gaffarsheikh »

balala wrote: December 3rd, 2019, 11:15 am Or beside mak_kawa's solution, here is another approach. Not sure in how many skins do you want to modify the font sizes, but in all of them you could replace the FontSize=10 (or 14) with this FontSize=(#WORKAREAWIDTH#/137). Using this formula the font size of the appropriate String meters will automatically adjusted according to the current screen resolution.
However I doubt this fixes all your problems, because in most cases changing the font size is far away from being enough, usually the skins has to be redesigned. But how can you do this, depends on a lot of things.
Yes, its perfect solution for my skin font resizing problem. Thank you.
* I need [Meter=Button] Button size change with screen resolution.


I make this skin for example, skin background, font, image are resizable with computer screen resolution.

Code: Select all

[Rainmeter]
Update=1000
OnRefreshAction = [!Move (0) (0)]


[Background]
Meter = Image
SolidColor=25,0,255,255
X = (#SCREENAREAWIDTH# / 500)
Y = (#SCREENAREAHEIGHT# / 500)
W = (#SCREENAREAWIDTH#  / 1.005)
H = (#SCREENAREAHEIGHT# / 1.05)
DynamicWindowSize=1


[Text]
Meter=String
Text=Wednesday
FontColor=255,255,255,255
Fontface=Calibri
FontSize=(#WORKAREAWIDTH#/6.8)
FontWeight=800
X = 0
Y = 0


[Text2]
Meter=String
Text=Friday
FontColor=255,255,255,255
Fontface=Calibri
FontSize=(#WORKAREAWIDTH#/10)
FontWeight=800
X = 50
Y = 400
Gaffar Sheikh
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Need font size change with WorkAreaWidth

Post by balala »

gaffarsheikh wrote: December 3rd, 2019, 11:17 pm Yes, its perfect solution for my skin font resizing problem.
I'm glad.
gaffarsheikh wrote: December 3rd, 2019, 11:17 pm I make this skin for example, skin background, font, image are resizable with computer screen resolution.
Just note that although not a great problem and this doesn't prevent the skin or the option to work, including the parameters of the !Move bang (within the OnRefreshAction option) into parenthesis doesn't make too much sense: OnRefreshAction = [!Move "0" "0"].