It is currently March 29th, 2024, 5:25 am

Solved: Random FontFace from text file or @Resources folder

Get help with installing and using Rainmeter.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Random FontFace from text file or @Resources folder

Post by jsmorley »

No, there is something wrong. I can't yet put my finger on it. The value of the measure getting the font is changing, but the String meter isn't using it.
the_metal_lord
Posts: 27
Joined: April 3rd, 2018, 12:50 pm

Re: Random FontFace from text file or @Resources folder

Post by the_metal_lord »

balala wrote:Same for me. It works well.
Probably the problem is with the UpdateDivider=300 option of the [MeasureFontFace] measure. Due to this option, the measure updates once per 5 minutes, so the font is changed rarely enough to be hard to be seen.
the_metal_lord, please remove the above option and let us know if the font is changed each second.
I've tried with UpdateDivider=2 and also removing that, still the same result (still out of 9 fonts, only 1 shows and the default font).

Are you seeing all the 9 fonts? or only 2 fonts?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Random FontFace from text file or @Resources folder

Post by jsmorley »

As he says, it is only "using" the last font name in the file. Puzzling...
the_metal_lord
Posts: 27
Joined: April 3rd, 2018, 12:50 pm

Re: Random FontFace from text file or @Resources folder

Post by the_metal_lord »

jsmorley wrote:As he says, it is only "using" the last font name in the file. Puzzling...
In the forum, I was reading couple days ago you helped fix some skins that randomly changes image or color, maybe that type of technique will work here!?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Random FontFace from text file or @Resources folder

Post by jsmorley »

I think the problem is that Quote plugin is returning the linefeed characters from the file as a part of the string. Lemmie dig a bit further.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Random FontFace from text file or @Resources folder

Post by jsmorley »

Yep...

Code: Select all

[MeasureFontFace]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName=#CURRENTPATH#FontFace.txt
UpdateDivider=2
RegExpSubstitute=1
Substitute="\r":"","\n":""
The Quote plugin is returning

Code: Select all

Lemonade

As the string value, as it is returning the \r\n (carriage return / linefeed) characters from the end of all the lines except the last one as a part of the string. Then FontFace can't match it.

So I remove the \r\n from the string, and all is well.

I increasingly hate the Quote plugin...
the_metal_lord
Posts: 27
Joined: April 3rd, 2018, 12:50 pm

Re: Random FontFace from text file or @Resources folder

Post by the_metal_lord »

:jawdrop
You're freaking awesome! Thanks a lot! :17good
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5384
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Random FontFace from text file or @Resources folder

Post by eclectic-tech »

Rather than using the Quote plugin to determine the font (which may return the same font several times in a row) and also return the understandable \r\n.

I would use a calc measure and substitution to return a unique font every time. Replace your [MeasureFontFace] with this:

Code: Select all

[MeasureFontFace]
Measure=Calc
Formula=Random
LowBound=0
HighBound=8
UniqueRandom=1
UpdateRandom=1
UpdateDivider=300
Substitute="0":"BeautySchoolDropout","1":"Caviar Dreams","2":"Keyboard Plaque","3":"Lemonade","4":"Mido","5":"Nexa Light","6":"Peignot","7":"Satellite","8":"TT Chocolates Thin"
There are many ways to achieve similar results, just thought I would offer an alternative :D

EDIT: Set HighBound to '8' doh! :p
the_metal_lord
Posts: 27
Joined: April 3rd, 2018, 12:50 pm

Re: Random FontFace from text file or @Resources folder

Post by the_metal_lord »

This is pretty awesome! :17good
Somehow it sometimes shows one font twice, not sure if it's because of updating pretty fast or what
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Random FontFace from text file or @Resources folder

Post by jsmorley »

the_metal_lord wrote:This is pretty awesome! :17good
Somehow it sometimes shows one font twice, not sure if it's because of updating pretty fast or what
It still could if the last one it picks is say 5, and then it starts over and the first one it picks is 5. Going to be quite a bit more rare than the alleged "random" in Quote plugin though.