It is currently March 28th, 2024, 3:00 pm

My First Skin Help

Get help with creating, editing & fixing problems with skins
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

Yincognito wrote: July 28th, 2021, 5:09 pm ... make sure you check the modifications and feel free to change back the meters' positioning by swapping comments on the X/Y parts, ...
If this is in reference to my request to top-center the image it just moved the entire skin to the right. Here is a snip of the mod I did:

from -
*** LeftTop: FontChooser; RightTop: Temperature
X=(5)
Y=(5)
*** CenterTop: FontChooser; LeftBottom: Temperature
;X=([Temperature:W]/2-[FontChooser:W]/2)
;Y=(5)

to -
*** LeftTop: FontChooser; RightTop: Temperature
;X=(5)
;Y=(5)
*** CenterTop: FontChooser; LeftBottom: Temperature
X=([Temperature:W]/2-[FontChooser:W]/2)
Y=(5)

did I goof?
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

MourningStar wrote: July 28th, 2021, 6:22 pmLookin' good in the neighborhood! You, sir, are a star. :thumbup:
A star or an angel? Cause you seem to be undecided on this... :lol:
Joking aside, I'm glad you like it. :great:
MourningStar wrote: July 28th, 2021, 6:22 pmFirst observation (Issue could be on my end):

When I middle mouse clik on the image (camera in this skin) it toggles between system and skin's font folder (which has 11 fonts btw) correct? If yes, when the fonts folder is 'active' I am noticing that the last font remains displayed and I go thru a total of 16 cliks. I would expect only 10 cliks for the 11 fonts to appear. I see and expect this when the system fonts is 'active' because many fonts look identical. I will not require system fonts availability so I will have no need of that code or middlemouse switching code etc. relative code.

thoughts?
No, the "issue" is not on your end, it's not on mine either, and it's not on the code either - and it happens to me too, forgot to mention it, even though I was sure you'd have a question about it. It's just that one (or some of the fonts there) - I believe it's the NewMedia.ttf ones - yields multiple identical "font names" entries, and this is clearly visible in my RainFont version of the code, which displays both the font name and its index, but can be seen if you run the commands in PowerShell itself as well (I placed those fonts in my D:\aaa folder here for simplicity):
PSFonts.jpg
You can clearly see that both when getting the font names from all the files in the folder, as well as those specific "identical multi-font" TTF-s, the commands yield multiple entries. I have no idea why as I'm not really an expert in fonts, but you can rest assured that nothing is "malfunctioning" anywhere. If you're annoyed by it, just replace those "multi-font" files with others or something along those lines. :confused:

P.S. For easy copy paste testing, the commands are:

Code: Select all

Add-Type -AssemblyName PresentationCore; Get-ChildItem 'CompletePathToYourFontFolderOrFile' -Include *.otf,*.ttf | Foreach-Object {(New-Object -TypeName Windows.Media.GlyphTypeface -ArgumentList $_.FullName).Win32FamilyNames.Values}
Obviously, replace the CompletePathToYourFontFolderOrFile part with your actual path, similar to how I did in the screenshots.
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

MourningStar wrote: July 28th, 2021, 10:40 pm If this is in reference to my request to top-center the image it just moved the entire skin to the right. Here is a snip of the mod I did:

from -
*** LeftTop: FontChooser; RightTop: Temperature
X=(5)
Y=(5)
*** CenterTop: FontChooser; LeftBottom: Temperature
;X=([Temperature:W]/2-[FontChooser:W]/2)
;Y=(5)

to -
*** LeftTop: FontChooser; RightTop: Temperature
;X=(5)
;Y=(5)
*** CenterTop: FontChooser; LeftBottom: Temperature
X=([Temperature:W]/2-[FontChooser:W]/2)
Y=(5)

did I goof?
No, you did perfectly well, but I suspect you only did this for one of the meters, right? If you do it for both, this is what you get:
BDT.jpg
Remember, as I said earlier, these 2 meters depend on each other, positionally. ;-)
Only for verifying yourself:

Code: Select all

[FontChooser]
; Started/stopped the on demand animation on mouse hover/leave, chose the font (index) on mouse scroll, chose the font list (index) on middle click below
Meter=Image
*** LeftTop: FontChooser; RightTop: Temperature
;X=(5)
;Y=(5)
*** CenterTop: FontChooser; LeftBottom: Temperature
X=([Temperature:W]/2-[FontChooser:W]/2)
Y=(5)
W=(90*#Scale#)
H=(90*#Scale#)
ImageName=#@#Images\camera.png
ImageCrop=(160*(#Index#-1)),0,160,160,1
UpdateDivider=-1
MouseOverAction=[!CommandMeasure Slider "Stop 1"][!CommandMeasure Slider "Stop 2"][!CommandMeasure Slider "Execute 1"]
MouseLeaveAction=[!CommandMeasure Slider "Stop 1"][!CommandMeasure Slider "Stop 2"][!SetVariable Index 1][!UpdateMeasure Slider][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable FontIndex (([FontCount]+#FontIndex#+1)%[FontCount])][!WriteKeyValue Variables FontIndex "[#FontIndex]" "#@#Variables.inc"][!UpdateMeasure FontFace][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable FontIndex (([FontCount]+#FontIndex#-1)%[FontCount])][!WriteKeyValue Variables FontIndex "[#FontIndex]" "#@#Variables.inc"][!UpdateMeasure FontFace][!UpdateMeter *][!Redraw]
MiddleMouseUpAction=[!SetVariable FontListIndex (1-#FontListIndex#)][!SetVariable FontIndex 0][!UpdateMeasure FontList][!CommandMeasure FontList "Run"]
DynamicVariables=1

[Temperature]
Meter=String
*** LeftTop: FontChooser; RightTop: Temperature
;X=(10*#Scale#)R
;Y=(5*#Scale#)r
*** CenterTop: FontChooser; LeftBottom: Temperature
X=(0*#Scale#)
Y=(5*#Scale#)R
FontFace=[FontFace]
FontSize=(55*#Scale#)
FontColor=#FontColor#
StringStyle=Normal
StringAlign=Left
StringEffect=Shadow
FontEffectColor=0,0,0,50
SolidColor=0,0,0,1
Antialias=1
MeasureName=@CurrentTemperature
MeasureName2=CurrentTemperatureF
Text=%1°C / %2°F
; Added to change the text size by scrolling the mouse wheel up or down
MiddleMouseUpAction=[!ToggleMeter FontChooser][!Redraw]
MouseScrollUpAction=[!SetVariable Scale (Clamp(#Scale#+0.05,0.1,3))][!WriteKeyValue Variables Scale (Clamp(#Scale#+0.05,0.1,3))][!UpdateMeter *][!Redraw]
MouseScrollDownAction=[!SetVariable Scale (Clamp(#Scale#-0.05,0.1,3))][!WriteKeyValue Variables Scale (Clamp(#Scale#-0.05,0.1,3))][!UpdateMeter *][!Redraw]
DynamicVariables=1
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

Yincognito wrote: No, you did perfectly well, but I suspect you only did this for one of the meters, right? ...
right! Fixed and functioning - thx!
Yincognito wrote:... You can clearly see ...
Really - are you serious?!?!?!?
hey, ' ...For Dummies' manuals are a challenge to me!
:uhuh:


As mentioned, I have a personal font folder ready to go. I want to remove/downsize code so it only scrolls thru the skin's font folder and no need of the middle clik for switching. I can attempt this, but as you've seen already, I flubbed something so simple I fear I will do more damage than good. However, give me a day or two to give it a try and hope I don't return with tail 'tween legs ...
:oops:
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

Image center top lets me dock the skin's text nicely to the left-right-bottom screen edge. Image can be moved to center bottom for top screen docking. fwiw, the plasma ball animates. Will make new animation that cycles sun & moon, maybe add planets, rotating nebulas, fireworks etc. etc.
Attachments
Capture.PNG
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

MourningStar wrote: July 28th, 2021, 11:44 pmReally - are you serious?!?!?!?
hey, ' ...For Dummies' manuals are a challenge to me!
:uhuh:
Well, you said you understand better when visuals are involved, so that's what I was referring to, since I attached the screenshot. I mean, right click on the Start button, choose PowerShell, paste the commands => "clearly see" what the output is and how a single TTF can yield multiple identical font names... :confused:
MourningStar wrote: July 28th, 2021, 11:44 pmAs mentioned, I have a personal font folder ready to go. I want to remove/downsize code so it only scrolls thru the skin's font folder and no need of the middle clik for switching. I can attempt this, but as you've seen already, I flubbed something so simple I fear I will do more damage than good. However, give me a day or two to give it a try and hope I don't return with tail 'tween legs ...
:oops:
In general, as long as you backup stuff before attempting changes, nothing wrong can happen if you try. Plus, if one never tries it by himself, he'll never really learn - so go ahead, just make sure you try to understand first what each thing is doing (the comments I placed might be useful with that). I'll give you a hint though: the code you look to have will resemble the "original" system font scroller, except that the RunCommand measure's Program and Parameter options will have their "font folder" form (i.e. the Program/Parameter indexed as 1). Basically, it's more or less about removing the middle click action, replacing the RunCommand measure's Program and Parameter option values with the contents of the Program1 and Parameter1 variables, keeping the Substitute option in that measure unchanged and optionally removing the ProgramN / ParameterN variables once you're done as they won't serve any purpose anymore.
MourningStar wrote: July 29th, 2021, 3:06 am Image center top lets me dock the skin's text nicely to the left-right-bottom screen edge. Image can be moved to center bottom for top screen docking. fwiw, the plasma ball animates. Will make new animation that cycles sun & moon, maybe add planets, rotating nebulas, fireworks etc. etc.
That looks excellent! :thumbup:
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

Yincognito wrote: July 29th, 2021, 9:49 am That looks excellent! :thumbup:
Thank you -
so far ...after some study this first change:

from -

Program0=
Parameter0=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /s

Program1=powershell
Parameter1=Add-Type -AssemblyName PresentationCore; Get-ChildItem '#@#Fonts\*.*' -Include *.otf,*.ttf | Foreach-Object {(N ...

to -

;Program0=
;Parameter0=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /s

Program1=powershell
Parameter1=Add-Type -AssemblyName PresentationCore; Get-ChildItem '#@#Fonts\*.*' -Include *.otf,*.ttf | Foreach-Object {(N ...

... results in preventing the middle clik from switching to the system fonts resulting in the scrolling of my custom fonts only. I don't know why, for some reason the scroll goes smoothly thru all my fonts without that multiple/no-change scroll anomaly reported earlier. I'm happy, Now, onto some real (brain salad) surgery.
8-)
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

MourningStar wrote: July 29th, 2021, 3:45 pm Thank you -
so far ...after some study this first change:

from -

Program0=
Parameter0=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /s

Program1=powershell
Parameter1=Add-Type -AssemblyName PresentationCore; Get-ChildItem '#@#Fonts\*.*' -Include *.otf,*.ttf | Foreach-Object {(N ...

to -

;Program0=
;Parameter0=reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts" /s

Program1=powershell
Parameter1=Add-Type -AssemblyName PresentationCore; Get-ChildItem '#@#Fonts\*.*' -Include *.otf,*.ttf | Foreach-Object {(N ...

... results in preventing the middle clik from switching to the system fonts resulting in the scrolling of my custom fonts only. I don't know why, for some reason the scroll goes smoothly thru all my fonts without that multiple/no-change scroll anomaly reported earlier. I'm happy, Now, onto some real (brain salad) surgery.
8-)
Actually, that middle click now results in PowerShell running again to get those folder fonts and, if I'm not mistaken, it also resets the font index to 0, because those happen in the corresponding mouse action option, so I'm not sure it's as it should be, but then, if the client is happy, who am I to tell him not to be? :lol:
User avatar
MourningStar
Posts: 287
Joined: June 12th, 2016, 2:40 am

Re: My First Skin Help

Post by MourningStar »

Yincognito wrote: July 29th, 2021, 6:13 pm Actually, that middle click now results in PowerShell running again to get those folder fonts and, if I'm not mistaken, it also resets the font index to 0, because those happen in the corresponding mouse action option, ...
Let's see if I understand your reply. I really accomplished next to nothing. Each time the skin loads as a result of 'refresh' or pc power-up/restart the skin reverts back to some default font I cannot seem to locate and I must again middle clik to inform the skin to read the skin's custom font folder, as well as positions the skin back to 'some' default location on the screen. no, this is not what the client wants to happen, so the work continues ...
User avatar
Yincognito
Rainmeter Sage
Posts: 7023
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: My First Skin Help

Post by Yincognito »

MourningStar wrote: July 29th, 2021, 7:19 pm Let's see if I understand your reply. I really accomplished next to nothing. Each time the skin loads as a result of 'refresh' or pc power-up/restart the skin reverts back to some default font I cannot seem to locate and I must again middle clik to inform the skin to read the skin's custom font folder, as well as positions the skin back to 'some' default location on the screen. no, this is not what the client wants to happen, so the work continues ...
Yeah, that too. Well, you could just leave the Program/Parameter no. 0 uncommented but with the values from no. 1, and comment no. 1 instead which would have no. 0 values. That would solve the refresh problem, but the middle click one would remain - if that bothers you, that is.
Post Reply