It is currently April 27th, 2024, 5:37 pm

How to make %A display the parameters of [MeterDay]

Get help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 16177
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make %A display the parameters of [MeterDay]

Post by balala »

Pyuahowaito wrote: December 20th, 2023, 4:45 am I don't know how to proceed.
Add the [Variables] section to the code and add the FontColor variable there (the section and the variable is not added at least into the posted code):

Code: Select all

[Variables]
FontColor=228,138,145
Add the following two options into the [MeterDate] meter:

Code: Select all

[MeterDate]
...
InlineSetting=Color | 3,6,205
InlinePattern=(\d)
...
See what these options do: the InlinePattern match all digits (numbers) into the string shown by the meter. This string is in fact the date returned by the [MeasureDate] measure, as posted into the code. Since this date contains both, string and numbers, the numbers are match by the code of the InlinePattern option. The color set by the InlineSetting option is applied to these numbers.
Obviously the colors set above by the FontColor variable and the InlineSetting option are just examples. You have to use the desired color codes. Let us know if you succeeded in getting this to properly work.
User avatar
Pyuahowaito
Posts: 50
Joined: January 3rd, 2022, 2:44 pm

Re: How to make %A display the parameters of [MeterDay]

Post by Pyuahowaito »

balala wrote: December 20th, 2023, 4:25 pm Add the [Variables] section to the code and add the FontColor variable there (the section and the variable is not added at least into the posted code):

Code: Select all

[Variables]
FontColor=228,138,145
Add the following two options into the [MeterDate] meter:

Code: Select all

[MeterDate]
...
InlineSetting=Color | 3,6,205
InlinePattern=(\d)
...
See what these options do: the InlinePattern match all digits (numbers) into the string shown by the meter. This string is in fact the date returned by the [MeasureDate] measure, as posted into the code. Since this date contains both, string and numbers, the numbers are match by the code of the InlinePattern option. The color set by the InlineSetting option is applied to these numbers.
Obviously the colors set above by the FontColor variable and the InlineSetting option are just examples. You have to use the desired color codes. Let us know if you succeeded in getting this to properly work.
Thank you Balala for your help and tips. This method is perfect and works normally. Secondly, can you customize more fonts in the time format? Such as FontSize, FontFace, StringStyle, etc.
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to make %A display the parameters of [MeterDay]

Post by Yincognito »

Pyuahowaito wrote: December 20th, 2023, 7:44 pmSecondly, can you customize more fonts in the time format? Such as FontSize, FontFace, StringStyle, etc.
Yes, you can, and it has been already mentioned...
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16177
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make %A display the parameters of [MeterDay]

Post by balala »

Pyuahowaito wrote: December 20th, 2023, 7:44 pm Secondly, can you customize more fonts in the time format? Such as FontSize, FontFace, StringStyle, etc.
Just a few details related to Yincognito's reply:
  • To customize the size of the fonts: InlineSetting=Size | 16 - to apply a size of 16 to the strings matching the InlinePattern.
  • For FontFace: InlineSetting=Face | Arial
  • For style you can use the Weight setting. This setting is parcticaly doing the same thing as the StringStyle=Bold, but adds additional settings. For instance: InlineSetting=Weight | 400 may be used to set "normal" style, while with InlineSetting=Weight | 700 you set the Bold style. See the additional Weights on the Weight setting here.
  • There are plenty of other settings available here. For example, to set an Italic style use the InlineSetting=Italic option (no parameters this time).
  • You can add few settings which are not available on the basic settings of the String meters. For instance you can add shadow to the string (InlineSetting=Shadow | 2 | 2 | 3.5 | 150,150,150,200), which hardly can be done without using Inline.
User avatar
Pyuahowaito
Posts: 50
Joined: January 3rd, 2022, 2:44 pm

Re: How to make %A display the parameters of [MeterDay]

Post by Pyuahowaito »

balala wrote: December 20th, 2023, 8:14 pm Just a few details related to Yincognito's reply:
  • To customize the size of the fonts: InlineSetting=Size | 16 - to apply a size of 16 to the strings matching the InlinePattern.
  • For FontFace: InlineSetting=Face | Arial
  • For style you can use the Weight setting. This setting is parcticaly doing the same thing as the StringStyle=Bold, but adds additional settings. For instance: InlineSetting=Weight | 400 may be used to set "normal" style, while with InlineSetting=Weight | 700 you set the Bold style. See the additional Weights on the Weight setting here.
  • There are plenty of other settings available here. For example, to set an Italic style use the InlineSetting=Italic option (no parameters this time).
  • You can add few settings which are not available on the basic settings of the String meters. For instance you can add shadow to the string (InlineSetting=Shadow | 2 | 2 | 3.5 | 150,150,150,200), which hardly can be done without using Inline.

I read Inline Options but still don't understand how to modify the time format of other places or more, such as %A. I'm sorry that I didn't ask clearly. Thank you for your detailed explanation of InlineSetting. :rosegift:
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: How to make %A display the parameters of [MeterDay]

Post by Yincognito »

Pyuahowaito wrote: December 20th, 2023, 8:41 pm I read Inline Options but still don't understand how to modify the time format of other places or more, such as %A.
To control where you apply the inline settings, you must change the regular expression you use in InlinePattern...=...
To control what you apply in the inline settings, you must change the type of setting you use in InlineSetting...=...
To apply more inline settings, you must add corresponding pairs of InlinePatternN=... and InlineSettingN=... to the meter (N starts at 2)

As for regular expressions, you can take a look at regex101.com or regexr.com to get familiar with them. It may seem overwhelming, but it's not that hard, they're about 30 commonly used symbols / signs to look into a string for a match (which is what reggular expressions do). If you still don't know how to use them, you could explain where exactly you want the change to happen and get some help on that.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16177
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make %A display the parameters of [MeterDay]

Post by balala »

Pyuahowaito wrote: December 20th, 2023, 8:41 pm I read Inline Options but still don't understand how to modify the time format of other places or more, such as %A.
See Yincognito's above reply. Recommend to follow his advices, to get familiar with regular expressions.
But for a quick help, here is my approach: to modify the format of the weekday name (so the last, non-numeric part of the string), you can apply the following InlinePattern: InlinePattern=([^0-9]*). This means all non-digit characters: letters in this case. To give you a few details:
  • [0-9] returns the digits (from 0 to 9)
  • The ^ character, tells you need the characters which are not those added after it: [^0-9] means NO digits.
  • The * is indicating that there might be more such, non-digit characters.
  • Finally the parenthesis tell Rainmeter to capture all these characters. The appropriate InlineSetting is applied to all captured characters.
Obviously as Yincognito said, if you want to keep the previous InlineSetting and InlinePattern, you have to number all these options. In such a case, the above InlinePattern and InlineSetting become: InlinePattern2=([^0-9]*), respectively InlinePattern2=Italic. Note that this requires to have valid InlinePattern and InlineSetting options.
User avatar
Pyuahowaito
Posts: 50
Joined: January 3rd, 2022, 2:44 pm

Re: How to make %A display the parameters of [MeterDay]

Post by Pyuahowaito »

I already understand most of it, thank you very much for your help :rosegift:
User avatar
balala
Rainmeter Sage
Posts: 16177
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: How to make %A display the parameters of [MeterDay]

Post by balala »

Pyuahowaito wrote: December 21st, 2023, 7:36 pm I already understand most of it, thank you very much for your help :rosegift:
:thumbup: :great: