It is currently March 29th, 2024, 5:25 am
Solved: Random FontFace from text file or @Resources folder
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Random FontFace from text file or @Resources folder
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.
-
- Posts: 27
- Joined: April 3rd, 2018, 12:50 pm
Re: Random FontFace from text file or @Resources folder
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).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.
Are you seeing all the 9 fonts? or only 2 fonts?
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Random FontFace from text file or @Resources folder
As he says, it is only "using" the last font name in the file. Puzzling...
-
- Posts: 27
- Joined: April 3rd, 2018, 12:50 pm
Re: Random FontFace from text file or @Resources folder
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!?jsmorley wrote:As he says, it is only "using" the last font name in the file. Puzzling...
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Random FontFace from text file or @Resources folder
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.
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Random FontFace from text file or @Resources folder
Yep...
The Quote plugin is returning
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...
Code: Select all
[MeasureFontFace]
Measure=Plugin
Plugin=Plugins\QuotePlugin.dll
PathName=#CURRENTPATH#FontFace.txt
UpdateDivider=2
RegExpSubstitute=1
Substitute="\r":"","\n":""
Code: Select all
Lemonade
So I remove the \r\n from the string, and all is well.
I increasingly hate the Quote plugin...
-
- Posts: 27
- Joined: April 3rd, 2018, 12:50 pm
Re: Random FontFace from text file or @Resources folder
You're freaking awesome! Thanks a lot!
-
- 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
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:There are many ways to achieve similar results, just thought I would offer an alternative
EDIT: Set HighBound to '8' doh!
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"
EDIT: Set HighBound to '8' doh!
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 27
- Joined: April 3rd, 2018, 12:50 pm
Re: Random FontFace from text file or @Resources folder
This is pretty awesome!
Somehow it sometimes shows one font twice, not sure if it's because of updating pretty fast or what
Somehow it sometimes shows one font twice, not sure if it's because of updating pretty fast or what
-
- Developer
- Posts: 22628
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: Random FontFace from text file or @Resources folder
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.the_metal_lord wrote:This is pretty awesome!
Somehow it sometimes shows one font twice, not sure if it's because of updating pretty fast or what