It is currently September 29th, 2024, 9:28 am

IfCondition to display a String when Rainmeter is unable to find Font?

General topics related to Rainmeter.
x_magnumse_x
Posts: 21
Joined: May 23rd, 2013, 2:52 pm

IfCondition to display a String when Rainmeter is unable to find Font?

Post by x_magnumse_x »

Hi :welcome:

So I'm working on an options menu for my skin where you can type in the name of the font to change it.
But I want it to throw an error-message to the user if the user misspelled or if the font doesn't exist.

Is this possible? and if yes, how?

Thank you,

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

Re: IfCondition to display a String when Rainmeter is unable to find Font?

Post by jsmorley »

No, it really is not.

Rainmeter does not consider a FontFace that it can't find in memory as an "error", and just quietly replaces it with the default, I think Arial or something.

There is really no way I can think of with Rainmeter alone. FontFace is not based on any file name, so there is really just no way to ask if the font family exists.
x_magnumse_x
Posts: 21
Joined: May 23rd, 2013, 2:52 pm

Re: IfCondition to display a String when Rainmeter is unable to find Font?

Post by x_magnumse_x »

Wouldn't it be possible to do something like:

Code: Select all

IfCondition= (#FontVariable# = Arial)
IfTrueAction=[!SetOption ErrorMessage Text "Unable to find font"][!Redraw]
User avatar
jsmorley
Developer
Posts: 22783
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IfCondition to display a String when Rainmeter is unable to find Font?

Post by jsmorley »

x_magnumse_x wrote:Wouldn't it be possible to do something like:

Code: Select all

IfCondition= (#FontVariable# = Arial)
IfTrueAction=[!SetOption ErrorMessage Text "Unable to find font"][!Redraw]
No, Rainmeter does not keep track of, or expose to the skin, what font it is using.

I think getting a FontFace from the user via InputText is a bad idea. They are going to get it wrong about 60% of the time. Provide a list of either standard Windows fonts, or ones you include with the skin in @Resources\Fonts, and let them select from the list.

That's just my opinion of course, all I can really do is tell you what is possible, and what you want just isn't.
x_magnumse_x
Posts: 21
Joined: May 23rd, 2013, 2:52 pm

Re: IfCondition to display a String when Rainmeter is unable to find Font?

Post by x_magnumse_x »

Ok. I understand.

Thanks for your help as always!

Love you!