It is currently March 28th, 2024, 10:22 pm

how to change a text height.. only height

Get help with creating, editing & fixing problems with skins
User avatar
hermitic-boogey-man
Posts: 5
Joined: December 12th, 2020, 8:54 am

how to change a text height.. only height

Post by hermitic-boogey-man »

please help.. :welcome: . I want to make the text little bit taller here is the code

Code: Select all

[Rainmeter]
Update=1000

[Variables]



[MeasureDate]
Measure=Time
Format=%Y

[TextStyle]
FontFace=Cloudlike
FontColor=232, 233, 227

[MeterDate]
Meter=String
MeasureName=MeasureDate
MeterStyle=TextStyle
InlineSetting=Shadow | 5 | 1 | 2 | 189,190,210
FontSize=50
X=200
Y=200
Text="%1"
AntiAlias=1

User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: how to change a text height.. only height

Post by jsmorley »

hermitic-boogey-man wrote: January 10th, 2021, 5:17 pm please help.. :welcome: . I want to make the text little bit taller here is the code

Code: Select all

[Rainmeter]
Update=1000

[Variables]



[MeasureDate]
Measure=Time
Format=%Y

[TextStyle]
FontFace=Cloudlike
FontColor=232, 233, 227

[MeterDate]
Meter=String
MeasureName=MeasureDate
MeterStyle=TextStyle
InlineSetting=Shadow | 5 | 1 | 2 | 189,190,210
FontSize=50
X=200
Y=200
Text="%1"
AntiAlias=1

You really can't change the width or height of a font. You would have to change the height of the meter containing the string, using https://docs.rainmeter.net/manual/meters/general-options/#TransformationMatrix.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to change a text height.. only height

Post by balala »

hermitic-boogey-man wrote: January 10th, 2021, 5:17 pm I want to make the text little bit taller
As jsmorely said, the solution is the TransformationMatrix, which can be used among others, to scale the meter either horizonatally, vertically or both. This time you have to scale it only vertically, but for this you have to add a properly written TransformationMatrix to the [MeterDate] meter.
Here is what would I do: first add a Scale=2 (or whatever value would you like) variable to the [Variables] section. As you probably figured it out, this will be the scaling factor, Scale=2 for instance means doubling the height of the meter.
Now add the following two options to the [MeterDate] meter:

Code: Select all

[MeterDate]
...
TransformationMatrix=1;0;0;#Scale#;0;([#CURRENTSECTION#:Y]-#Scale#*([#CURRENTSECTION#:X]+[#CURRENTSECTION#:H]))
DynamicVariables=1
The above option increases the height of the meter by a number of times equal with #Scale#. The code doesn't keep the upper part of the meter unmoved, but its bottom part. I had to choose this solution, because if there is nothing else below this meter and I keep its upper part on the same position, get the below part cut off, because even if visualy the height of the meter is changing, in fact Rainmeter still sees it with its original (unscaled) height and the bottom part goes outside of the skin.
Please test the code and let me know how does it work.
User avatar
CodeCode
Posts: 1363
Joined: September 7th, 2020, 2:24 pm
Location: QLD, Australia

Re: how to change a text height.. only height

Post by CodeCode »

You might like this - I've attached a font (ttf in a zip).
VertigoFLF.zip
FontFace=VertigoFLF
You do not have the required permissions to view the files attached to this post.
ƈǟռ'ȶ ʄɨӼ ɨȶ ɨʄ ɨȶ ǟɨռ'ȶ ɮʀօӄɛ - ʊռʟɛֆֆ ɨȶ ɨֆ ɨռ ƈօɖɛ.
User avatar
hermitic-boogey-man
Posts: 5
Joined: December 12th, 2020, 8:54 am

Re: how to change a text height.. only height

Post by hermitic-boogey-man »

thanks so much balala... Your Idea Work perfectly
balala wrote: January 10th, 2021, 8:03 pm As jsmorely said, the solution is the TransformationMatrix, which can be used among others, to scale the meter either horizonatally, vertically or both. This time you have to scale it only vertically, but for this you have to add a properly written TransformationMatrix to the [MeterDate] meter.
Here is what would I do: first add a Scale=2 (or whatever value would you like) variable to the [Variables] section. As you probably figured it out, this will be the scaling factor, Scale=2 for instance means doubling the height of the meter.
Now add the following two options to the [MeterDate] meter:

Code: Select all

[MeterDate]
...
TransformationMatrix=1;0;0;#Scale#;0;([#CURRENTSECTION#:Y]-#Scale#*([#CURRENTSECTION#:X]+[#CURRENTSECTION#:H]))
DynamicVariables=1
The above option increases the height of the meter by a number of times equal with #Scale#. The code doesn't keep the upper part of the meter unmoved, but its bottom part. I had to choose this solution, because if there is nothing else below this meter and I keep its upper part on the same position, get the below part cut off, because even if visualy the height of the meter is changing, in fact Rainmeter still sees it with its original (unscaled) height and the bottom part goes outside of the skin.
Please test the code and let me know how does it work.
:thumbup: but I Already have a transformation matrix option and when I add the second It did not Work ...any Ideas

Code: Select all

[Rainmeter]
Update=1000

[Variables]
RotateAngle=15
Scale=2
******************************************
[MeasureDay]
Measure=Time
Format="%A"

[Metadata]
Author=Hermitiv-boogey-man
Version=1.0
License=Free For Personal Use
Description=
Instructions=

[MeterBackground]
Meter=Image
W=(SQRT(600**2 + 38**2))
H=(SQRT(510**2 + 38**2))
SolidColor=255,255,255,255

***************************************


[TextStyle]
FontFace=Cloudlike
FontColor=232, 233, 227
******************************************
[MeterDay]
Meter=String
MeasureName=MeasureDay
InlineSetting=Shadow | 5 | 0 | 2 | 189,190,210
MeterStyle=TextStyle
StringAlign=Center
FontSize=70
X=220
Y=15([MeterBackground:H]-38)
AntiAlias=1
Container=MeterBackground
TransformationMatrix=(Cos(Rad([#RotateAngle])));(-Sin(Rad([#RotateAngle])));(Sin(Rad([#RotateAngle])));(Cos(Rad([#RotateAngle])));([#CURRENTSECTION#:X]-[#CURRENTSECTION#:X]*Cos(Rad([#RotateAngle]))-[#CURRENTSECTION#:Y]*Sin(Rad([#RotateAngle])));([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:X]*Sin(Rad([#RotateAngle]))-[#CURRENTSECTION#:Y]*Cos(Rad([#RotateAngle])))
TransformationMatrix2=1;0;0;#Scale#;0;([#CURRENTSECTION#:Y]-#Scale#*([#CURRENTSECTION#:X]+[#CURRENTSECTION#:H]))
DynamicVariables=1
***
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to change a text height.. only height

Post by balala »

hermitic-boogey-man wrote: January 11th, 2021, 9:40 am but I Already have a transformation matrix option and when I add the second It did not Work ...any Ideas
Yep, such in a case, you have to multiply together the two transformation matrices, as described in the Multiple Transformations in One! section of the TransformationMatrix Guide. Unfortunately you can't apply two transformation matrices onto one meter and this option doesn't let you to use a TransformationMatrix2 option. This second option is simply ignored, not being a valid option. So as said, the answer of your question is that you have to multiply the matrices together.
I rewrote the matrix I posted before, reducing it a little bit. Here is the newer expression I used: TransformationMatrix=1;0;0;#Scale#;0;([#CURRENTSECTION#:YH]*(1-#Scale#)). The second matrix used to rotate the meter is this:

Code: Select all

TransformationMatrix=(Cos(Rad([#RotateAngle])));(-Sin(Rad([#RotateAngle])));(Sin(Rad([#RotateAngle])));(Cos(Rad([#RotateAngle])));([#CURRENTSECTION#:X]-[#CURRENTSECTION#:X]*Cos(Rad([#RotateAngle]))-[#CURRENTSECTION#:Y]*Sin(Rad([#RotateAngle])));([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:X]*Sin(Rad([#RotateAngle]))-[#CURRENTSECTION#:Y]*Cos(Rad([#RotateAngle])))
Now multiplying them together, accordingly to the rules of matrices multiplication, this is what you get:

Code: Select all

TransformationMatrix=(Cos(Rad([#RotateAngle])));(-Sin(Rad([#RotateAngle])));(#Scale#*Sin(Rad([#RotateAngle])));(#Scale#*Cos(Rad([#RotateAngle])));(([#CURRENTSECTION#:YH]*(1-#Scale#))*(Sin(Rad([#RotateAngle])))+([#CURRENTSECTION#:X]-[#CURRENTSECTION#:X]*Cos(Rad([#RotateAngle]))-[#CURRENTSECTION#:Y]*Sin(Rad([#RotateAngle]))));([#CURRENTSECTION#:YH]*(1-#Scale#)*Cos(Rad([#RotateAngle])))
Quite long? Yep, you probably are right, it is, however I hope it does work (it definitely does for me). So give it a try please and let me know if it indeed does.
User avatar
hermitic-boogey-man
Posts: 5
Joined: December 12th, 2020, 8:54 am

Re: how to change a text height.. only height

Post by hermitic-boogey-man »

balala wrote: January 11th, 2021, 3:19 pm Yep, such in a case, you have to multiply together the two transformation matrices, as described in the Multiple Transformations in One! section of the TransformationMatrix Guide. Unfortunately you can't apply two transformation matrices onto one meter and this option doesn't let you to use a TransformationMatrix2 option. This second option is simply ignored, not being a valid option. So as said, the answer of your question is that you have to multiply the matrices together.
I rewrote the matrix I posted before, reducing it a little bit. Here is the newer expression I used: TransformationMatrix=1;0;0;#Scale#;0;([#CURRENTSECTION#:YH]*(1-#Scale#)). The second matrix used to rotate the meter is this:

Code: Select all

TransformationMatrix=(Cos(Rad([#RotateAngle])));(-Sin(Rad([#RotateAngle])));(Sin(Rad([#RotateAngle])));(Cos(Rad([#RotateAngle])));([#CURRENTSECTION#:X]-[#CURRENTSECTION#:X]*Cos(Rad([#RotateAngle]))-[#CURRENTSECTION#:Y]*Sin(Rad([#RotateAngle])));([#CURRENTSECTION#:Y]+[#CURRENTSECTION#:X]*Sin(Rad([#RotateAngle]))-[#CURRENTSECTION#:Y]*Cos(Rad([#RotateAngle])))
Now multiplying them together, accordingly to the rules of matrices multiplication, this is what you get:

Code: Select all

TransformationMatrix=(Cos(Rad([#RotateAngle])));(-Sin(Rad([#RotateAngle])));(#Scale#*Sin(Rad([#RotateAngle])));(#Scale#*Cos(Rad([#RotateAngle])));(([#CURRENTSECTION#:YH]*(1-#Scale#))*(Sin(Rad([#RotateAngle])))+([#CURRENTSECTION#:X]-[#CURRENTSECTION#:X]*Cos(Rad([#RotateAngle]))-[#CURRENTSECTION#:Y]*Sin(Rad([#RotateAngle]))));([#CURRENTSECTION#:YH]*(1-#Scale#)*Cos(Rad([#RotateAngle])))
Quite long? Yep, you probably are right, it is, however I hope it does work (it definitely does for me). So give it a try please and let me know if it indeed does.

And Yep sure it's work :thumbup: ..tnx so much :rosegift:
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: how to change a text height.. only height

Post by balala »

hermitic-boogey-man wrote: January 11th, 2021, 5:34 pm And Yep sure it's work :thumbup: ..tnx so much :rosegift:
Ok, I'm glad! :thumbup: