It is currently July 18th, 2019, 8:28 pm

pls help

Help with creating, editing & fixing problems with skins
sadijoon7
Posts: 3
Joined: July 7th, 2019, 9:34 pm

pls help

sadijoon7 » July 8th, 2019, 8:33 am

hi.i want add weekdays(شنبه.یکشنبه.دوشنبه.سه شنبه.چهارشنبه.پنجشنبه.جمعه) in persian(shamsi) calendar.pls help me

Code: Select all

[Rainmeter]
Author = https://github.com/adelghaenian
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=http://calendar.zoznam.sk/persian_calendar-en.php
RegExp=(?siU)<div id="headline21">.*: (.*)\. (.*) (.*)</div>

[MeasureDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=1

[MeasureYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=3

[MeasureMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=2
Substitute="Farvardin":"1","Ordibehesht":"2","Khordad":"3","Tir":"4","Mordad":"5","Shahrivar":"6","Mehr":"7","Aban":"8","Azar":"9","Dey":"10","Bahman":"11","Esfand":"12"




[Style1]
FontFace=Josefin Sans 
FontSize=40
StringStyle=thin
FontColor=ffffff
AntiAlias=1

[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,240,100|Fill Color 255,255,255,10 | StrokeWidth 1 | Stroke Color 255,255,255



[MeterYear]
Meter=String
MeasureName=MeasureYear
X=30
y=18
MeterStyle=Style1
AntiAlias=1


[MeterSplit]
X=120
y=18
Meter=String
MeterStyle=Style1
AntiAlias=1
Text=/


[MeterMonth]
Meter=String
MeasureName=MeasureMonth
X=140
y=18
MeterStyle=Style1
AntiAlias=1

[MeterSplit2]
X=170
y=18
Meter=String
MeterStyle=Style1
AntiAlias=1
Text=/

[MeterDay]
Meter=String
MeasureName=MeasureDay
X=190
y=18
MeterStyle=Style1
AntiAlias=1
Last edited by balala on July 8th, 2019, 12:16 pm, edited 1 time in total.
Reason: Please use <code> tags whenever are you posting code snippets. It's the </> button.
User avatar
ikarus1969
Posts: 331
Joined: February 28th, 2011, 3:20 pm
Location: Vienna, Austria

Re: pls help

ikarus1969 » July 8th, 2019, 12:24 pm

You can use the following code - please make sure to save it with coding "UTF LE" (UTF Little Endian):

I had to adapt the webparser measure and the String-indices. The weekday is coded in "MeasureWeekDay".

The substitution to persian names is in the following line - i hope it's ok (done with google-translate):

Code: Select all

Substitute="Doshanbeh":"دوشنبه","Seshhanbeh":"سه","Chaharshanbeh":"چهارشنبه","Panjshanbeh":"پنجشنبه","Jomeh":"جمعه","Shanbeh":"شنبه","Yekshanbeh":"یکشنبه"
Screenshot persian calendar.jpg

Code: Select all

[Rainmeter]
Author = https://github.com/adelghaenian
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=http://calendar.zoznam.sk/persian_calendar-en.php
RegExp=(?siU)<div id="headline21">(.*): (.*)\. (.*) (.*)</div>

[MeasureWeekDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=1
Substitute="Doshanbeh":"دوشنبه","Seshhanbeh":"سه","Chaharshanbeh":"چهارشنبه","Panjshanbeh":"پنجشنبه","Jomeh":"جمعه","Shanbeh":"شنبه","Yekshanbeh":"یکشنبه"

[MeasureDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=2

[MeasureYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=4

[MeasureMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=3
; شنبه.یکشنبه.دوشنبه.سه شنبه.چهارشنبه.پنجشنبه.جمعه
Substitute="Farvardin":"1","Ordibehesht":"2","Khordad":"3","Tir":"4","Mordad":"5","Shahrivar":"6","Mehr":"7","Aban":"8","Azar":"9","Dey":"10","Bahman":"11","Esfand":"12"




[Style1]
FontFace=Josefin Sans 
FontSize=40
StringStyle=Normal
FontColor=ffffff
AntiAlias=1

[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,(MAX([MeterWeekDay:XW], [MeterDay:XW]) + (2 * 30)),([MeterWeekDay:YH] + (2 * 18)) | Fill Color 255,255,255,10 | Stroke Color 255,255,255
DynamicVariables=1



[MeterYear]
Meter=String
MeasureName=MeasureYear
X=30
y=18
MeterStyle=Style1
AntiAlias=1


[MeterSplit]
X=0R
y=0r
Meter=String
MeterStyle=Style1
AntiAlias=1
Text=/


[MeterMonth]
Meter=String
MeasureName=MeasureMonth
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1

[MeterSplit2]
X=0R
y=0r
Meter=String
MeterStyle=Style1
AntiAlias=1
Text=/

[MeterDay]
Meter=String
MeasureName=MeasureDay
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1

[MeterWeekDay]
Meter=String
MeasureName=MeasureWeekDay
X=[MeterYear:X]
y=0R
MeterStyle=Style1
AntiAlias=1
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 8376
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: pls help

balala » July 8th, 2019, 12:38 pm

EDIT: Sorry ikarus1969, you beat me this time.
sadijoon7 wrote:
July 8th, 2019, 8:33 am
hi.i want add weekdays(شنبه.یکشنبه.دوشنبه.سه شنبه.چهارشنبه.پنجشنبه.جمعه) in persian(shamsi) calendar.pls help me
Depends on how would you like to add it. Would you want to get the name from the site or from your computer?
If you want to get it locally from your computer, you need a properly formatted Time measure. Something like this (add this measure to your code):

Code: Select all

[MeasureWeekday]
Measure=Time
Format=%A
FormatLocale=Local
If the default language of your OS is persian, you'll get the day name in Persian. If it's something else, then you have to change the FormatLocale=Local option to the appropriate language code, available here. For instance for Persian (Iran) use the following option: FormatLocale=fa-IR (or get the best language code from the link provided above).
If on the other hand the name is on the site, then my question is where is it, because I can't find it.
User avatar
jsmorley
Developer
Posts: 19293
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: pls help

jsmorley » July 8th, 2019, 12:54 pm

ikarus1969 wrote:
July 8th, 2019, 12:24 pm
You can use the following code - please make sure to save it with coding "UTF LE" (UTF Little Endian):
I would be tempted to make the following cosmetic changes, just to have it not show "unfinished" stuff before the site is parsed... Basically, just hide everything until the WebParser parent is done.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Metadata]
Author=https://github.com/adelghaenian

[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=http://calendar.zoznam.sk/persian_calendar-en.php
RegExp=(?siU)<div id="headline21">(.*): (.*)\. (.*) (.*)</div>
FinishAction=[!ShowMeterGroup myMeters][!UpdateMeterGroup myMeters][!UpdateMeter MeterShape][!Redraw]

[MeasureWeekDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=1
Substitute="Doshanbeh":"دوشنبه","Seshhanbeh":"سه","Chaharshanbeh":"چهارشنبه","Panjshanbeh":"پنجشنبه","Jomeh":"جمعه","Shanbeh":"شنبه","Yekshanbeh":"یکشنبه"

[MeasureDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=2

[MeasureYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=4

[MeasureMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=3
; شنبه.یکشنبه.دوشنبه.سه شنبه.چهارشنبه.پنجشنبه.جمعه
Substitute="Farvardin":"1","Ordibehesht":"2","Khordad":"3","Tir":"4","Mordad":"5","Shahrivar":"6","Mehr":"7","Aban":"8","Azar":"9","Dey":"10","Bahman":"11","Esfand":"12"

[Style1]
FontFace=Josefin Sans 
FontSize=40
StringStyle=Normal
FontColor=ffffff
AntiAlias=1
Group=myMeters
Hidden=1

[MeterShape]
Meter=Shape
Shape=Rectangle 0.5,0.5,(MAX([MeterWeekDay:XW], [MeterDay:XW]) + (2 * 30)),([MeterWeekDay:YH] + (2 * 18)) | Fill Color 255,255,255,10 | Stroke Color 255,255,255
MeterStyle=Style1
DynamicVariables=1

[MeterYear]
Meter=String
MeasureName=MeasureYear
X=30
y=18
MeterStyle=Style1
AntiAlias=1

[MeterSplit]
Meter=String
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1
Text=/

[MeterMonth]
Meter=String
MeasureName=MeasureMonth
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1

[MeterSplit2]
Meter=String
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1
Text=/

[MeterDay]
Meter=String
MeasureName=MeasureDay
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1

[MeterWeekDay]
Meter=String
MeasureName=MeasureWeekDay
X=[MeterYear:X]
y=0R
MeterStyle=Style1
AntiAlias=1
DynamicVariables=1
Note that I poke that shape meter [MeterShape] twice in the FinishAction, to be sure it is not "one update behind" with the sizing that it is deriving from other meters that come after it. It would be disconcerting to "see" it change size one update after it is all drawn.

One other minor tweak is that if you are going to have a "stroke" on your shape meter, you need to be sure that the entire stroke is contained in the skin. Remember that strokes are the "drawing line" of the shape and not a "border", and are drawn 1/2 "inside" the shape and 1/2 "outside" the shape. So you need to be sure the position allows that 1/2 that is "outside" to be drawn in the skin.

Code: Select all

Shape=Rectangle 0.5,0.5,(MAX([MeterWeekDay:XW], [MeterDay:XW]) + (2 * 30)),([MeterWeekDay:YH] + (2 * 18)) | Fill Color 255,255,255,10 | Stroke Color 255,255,255
So I just moved the shape in and down 0.5 pixels, or 1/2 of the size of the stroke. StrokeWidth defaults to 1px.

1.png
You do not have the required permissions to view the files attached to this post.
sadijoon7
Posts: 3
Joined: July 7th, 2019, 9:34 pm

Re: pls help

sadijoon7 » July 8th, 2019, 3:14 pm

ikarus1969 wrote:
July 8th, 2019, 12:24 pm
You can use the following code - please make sure to save it with coding "UTF LE" (UTF Little Endian):

I had to adapt the webparser measure and the String-indices. The weekday is coded in "MeasureWeekDay".

The substitution to persian names is in the following line - i hope it's ok (done with google-translate):

Code: Select all

Substitute="Doshanbeh":"دوشنبه","Seshhanbeh":"سه","Chaharshanbeh":"چهارشنبه","Panjshanbeh":"پنجشنبه","Jomeh":"جمعه","Shanbeh":"شنبه","Yekshanbeh":"یکشنبه"
Screenshot persian calendar.jpg

Code: Select all

[Rainmeter]
Author = https://github.com/adelghaenian
Update=1000
AccurateText=1
DynamicWindowSize=1

[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=http://calendar.zoznam.sk/persian_calendar-en.php
RegExp=(?siU)<div id="headline21">(.*): (.*)\. (.*) (.*)</div>

[MeasureWeekDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=1
Substitute="Doshanbeh":"دوشنبه","Seshhanbeh":"سه","Chaharshanbeh":"چهارشنبه","Panjshanbeh":"پنجشنبه","Jomeh":"جمعه","Shanbeh":"شنبه","Yekshanbeh":"یکشنبه"

[MeasureDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=2

[MeasureYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=4

[MeasureMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=3
; شنبه.یکشنبه.دوشنبه.سه شنبه.چهارشنبه.پنجشنبه.جمعه
Substitute="Farvardin":"1","Ordibehesht":"2","Khordad":"3","Tir":"4","Mordad":"5","Shahrivar":"6","Mehr":"7","Aban":"8","Azar":"9","Dey":"10","Bahman":"11","Esfand":"12"




[Style1]
FontFace=Josefin Sans 
FontSize=40
StringStyle=Normal
FontColor=ffffff
AntiAlias=1

[MeterShape]
Meter=Shape
Shape=Rectangle 0,0,(MAX([MeterWeekDay:XW], [MeterDay:XW]) + (2 * 30)),([MeterWeekDay:YH] + (2 * 18)) | Fill Color 255,255,255,10 | Stroke Color 255,255,255
DynamicVariables=1



[MeterYear]
Meter=String
MeasureName=MeasureYear
X=30
y=18
MeterStyle=Style1
AntiAlias=1


[MeterSplit]
X=0R
y=0r
Meter=String
MeterStyle=Style1
AntiAlias=1
Text=/


[MeterMonth]
Meter=String
MeasureName=MeasureMonth
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1

[MeterSplit2]
X=0R
y=0r
Meter=String
MeterStyle=Style1
AntiAlias=1
Text=/

[MeterDay]
Meter=String
MeasureName=MeasureDay
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1

[MeterWeekDay]
Meter=String
MeasureName=MeasureWeekDay
X=[MeterYear:X]
y=0R
MeterStyle=Style1
AntiAlias=1
wow thanks alot
sadijoon7
Posts: 3
Joined: July 7th, 2019, 9:34 pm

Re: pls help

sadijoon7 » July 8th, 2019, 3:15 pm

jsmorley wrote:
July 8th, 2019, 12:54 pm
I would be tempted to make the following cosmetic changes, just to have it not show "unfinished" stuff before the site is parsed... Basically, just hide everything until the WebParser parent is done.

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1
DynamicWindowSize=1

[Metadata]
Author=https://github.com/adelghaenian

[MeasureSite]
Measure=Plugin
Plugin=WebParser
URL=http://calendar.zoznam.sk/persian_calendar-en.php
RegExp=(?siU)<div id="headline21">(.*): (.*)\. (.*) (.*)</div>
FinishAction=[!ShowMeterGroup myMeters][!UpdateMeterGroup myMeters][!UpdateMeter MeterShape][!Redraw]

[MeasureWeekDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=1
Substitute="Doshanbeh":"دوشنبه","Seshhanbeh":"سه","Chaharshanbeh":"چهارشنبه","Panjshanbeh":"پنجشنبه","Jomeh":"جمعه","Shanbeh":"شنبه","Yekshanbeh":"یکشنبه"

[MeasureDay]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=2

[MeasureYear]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=4

[MeasureMonth]
Measure=Plugin
Plugin=WebParser
URL=[MeasureSite]
StringIndex=3
; شنبه.یکشنبه.دوشنبه.سه شنبه.چهارشنبه.پنجشنبه.جمعه
Substitute="Farvardin":"1","Ordibehesht":"2","Khordad":"3","Tir":"4","Mordad":"5","Shahrivar":"6","Mehr":"7","Aban":"8","Azar":"9","Dey":"10","Bahman":"11","Esfand":"12"

[Style1]
FontFace=Josefin Sans 
FontSize=40
StringStyle=Normal
FontColor=ffffff
AntiAlias=1
Group=myMeters
Hidden=1

[MeterShape]
Meter=Shape
Shape=Rectangle 0.5,0.5,(MAX([MeterWeekDay:XW], [MeterDay:XW]) + (2 * 30)),([MeterWeekDay:YH] + (2 * 18)) | Fill Color 255,255,255,10 | Stroke Color 255,255,255
MeterStyle=Style1
DynamicVariables=1

[MeterYear]
Meter=String
MeasureName=MeasureYear
X=30
y=18
MeterStyle=Style1
AntiAlias=1

[MeterSplit]
Meter=String
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1
Text=/

[MeterMonth]
Meter=String
MeasureName=MeasureMonth
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1

[MeterSplit2]
Meter=String
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1
Text=/

[MeterDay]
Meter=String
MeasureName=MeasureDay
X=0R
y=0r
MeterStyle=Style1
AntiAlias=1

[MeterWeekDay]
Meter=String
MeasureName=MeasureWeekDay
X=[MeterYear:X]
y=0R
MeterStyle=Style1
AntiAlias=1
DynamicVariables=1
Note that I poke that shape meter [MeterShape] twice in the FinishAction, to be sure it is not "one update behind" with the sizing that it is deriving from other meters that come after it. It would be disconcerting to "see" it change size one update after it is all drawn.

One other minor tweak is that if you are going to have a "stroke" on your shape meter, you need to be sure that the entire stroke is contained in the skin. Remember that strokes are the "drawing line" of the shape and not a "border", and are drawn 1/2 "inside" the shape and 1/2 "outside" the shape. So you need to be sure the position allows that 1/2 that is "outside" to be drawn in the skin.

Code: Select all

Shape=Rectangle 0.5,0.5,(MAX([MeterWeekDay:XW], [MeterDay:XW]) + (2 * 30)),([MeterWeekDay:YH] + (2 * 18)) | Fill Color 255,255,255,10 | Stroke Color 255,255,255
So I just moved the shape in and down 0.5 pixels, or 1/2 of the size of the stroke. StrokeWidth defaults to 1px.


1.png
thank y man :rosegift: