It is currently April 25th, 2024, 7:17 am

[Bug] FontWeight=0 error log

Report bugs with the Rainmeter application and suggest features.
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

[Bug] FontWeight=0 error log

Post by Virginityrocks »

Using FontWeight=0 causes errors in the event log.
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: [Bug] FontWeight=0 error log

Post by balala »

Virginityrocks wrote: March 17th, 2019, 2:23 pm Using FontWeight=0 causes errors in the event log.
I don't think this would be a bug. If you read the first sentence in the FontWeight option, its range is from 1 to 999. If you're out of this range, you get an error. Somehow normally.
The weight of the font in the range 1-999.
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: [Bug] FontWeight=0 error log

Post by jsmorley »

Correct. Do not use FontWeight to attempt to "hide" a meter.

in the world of fonts the weight just can't be "0", and it does not make sense to force / default an invalid FontWeight to "100" or "400" or "800" or anything really, as not every font always supports ANY particular weight value. Any default value will be making an assumption about both your intent and the font metrics that we can't legitimately make, so we produce an error if the value is below 1 or above 999, and throw the option away.

"1" means "lightest possible", "999" means "heaviest possible". We can't assume that "0" means anything at all. It can just be a broken formula. We need to warn you of broken formulas...

If you are using a formula to calculate a FontWeight, use Clamp() to ensure it can't be below 1 or above 999, or a ternary formula to force it to "400" or something if it is out of range. This is particularly important as using a dynamic #Variable# or (formula) as the value implies that DyanmicaVariables=1 will be on the meter, and that will cause the error to flood the log.
User avatar
Virginityrocks
Posts: 478
Joined: February 26th, 2011, 10:22 pm

Re: [Bug] FontWeight=0 error log

Post by Virginityrocks »

I suppose so. I guess I should have read the 1 to 999 bit. I figured the range started from 0 up. Thanks.